mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-18 19:10:21 -07:00
X.L.IndependentScreens: Added focusWorkspace function.
This commit is contained in:
parent
2b11459496
commit
619a347f3f
@ -45,6 +45,11 @@
|
||||
a client sends a **_NET_CURRENT_DESKTOP** request. It is now possible
|
||||
to change it using the `setEwmhSwitchDesktopHook`.
|
||||
|
||||
* `XMonad.Layout.IndependentScreens`
|
||||
|
||||
- Added `focusWorkspace` for focusing workspaces on the screen that they
|
||||
belong to.
|
||||
|
||||
## 0.18.1 (August 20, 2024)
|
||||
|
||||
### Breaking Changes
|
||||
|
@ -27,7 +27,7 @@ module XMonad.Layout.IndependentScreens (
|
||||
whenCurrentOn,
|
||||
countScreens,
|
||||
workspacesOn,
|
||||
workspaceOnScreen, focusWindow', focusScreen, nthWorkspace, withWspOnScreen,
|
||||
workspaceOnScreen, focusWindow', focusScreen, focusWorkspace, nthWorkspace, withWspOnScreen,
|
||||
-- * Converting between virtual and physical workspaces
|
||||
-- $converting
|
||||
marshall, unmarshall, unmarshallS, unmarshallW,
|
||||
@ -40,6 +40,7 @@ import XMonad
|
||||
import XMonad.Hooks.StatusBar.PP
|
||||
import XMonad.Prelude
|
||||
import qualified XMonad.StackSet as W
|
||||
import XMonad.Actions.OnScreen (viewOnScreen)
|
||||
|
||||
-- $usage
|
||||
-- You can use this module with the following in your @xmonad.hs@:
|
||||
@ -163,6 +164,11 @@ focusWindow' window ws
|
||||
focusScreen :: ScreenId -> WindowSet -> WindowSet
|
||||
focusScreen screenId = withWspOnScreen screenId W.view
|
||||
|
||||
-- | Focus the given workspace on the correct Xinerama screen.
|
||||
-- An example usage can be found at `XMonad.Hooks.EwmhDesktops.setEwmhSwitchDesktopHook`
|
||||
focusWorkspace :: WorkspaceId -> WindowSet -> WindowSet
|
||||
focusWorkspace workspaceId = viewOnScreen (unmarshallS workspaceId) workspaceId
|
||||
|
||||
-- | Get the nth virtual workspace
|
||||
nthWorkspace :: Int -> X (Maybe VirtualWorkspace)
|
||||
nthWorkspace n = (!? n) . workspaces' <$> asks config
|
||||
|
Loading…
x
Reference in New Issue
Block a user