Copyright | (c) 2009 Nils Schweinsberg |
---|---|
License | BSD3-style (see LICENSE) |
Maintainer | Nils Schweinsberg <mail@n-sch.de> |
Stability | unstable |
Portability | unportable |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Control workspaces on different screens (in xinerama mode).
Synopsis
- onScreen :: (WindowSet -> WindowSet) -> Focus -> ScreenId -> WindowSet -> WindowSet
- onScreen' :: X () -> Focus -> ScreenId -> X ()
- data Focus
- viewOnScreen :: ScreenId -> WorkspaceId -> WindowSet -> WindowSet
- greedyViewOnScreen :: ScreenId -> WorkspaceId -> WindowSet -> WindowSet
- onlyOnScreen :: ScreenId -> WorkspaceId -> WindowSet -> WindowSet
- toggleOnScreen :: ScreenId -> WorkspaceId -> WindowSet -> WindowSet
- toggleGreedyOnScreen :: ScreenId -> WorkspaceId -> WindowSet -> WindowSet
Usage
This module provides an easy way to control, what you see on other screens in
xinerama mode without having to focus them. Put this into your
~/.xmonad/xmonad.hs
:
import XMonad.Actions.OnScreen
Then add the appropriate keybindings, for example replace your current keys to switch the workspaces with this at the bottom of your keybindings:
++ [ ((m .|. modm, k), windows (f i)) | (i, k) <- zip (workspaces conf) ([xK_1 .. xK_9] ++ [xK_0]) , (f, m) <- [ (viewOnScreen 0, 0) , (viewOnScreen 1, controlMask) , (greedyView, controlMask .|. shiftMask) ] ]
This will provide you with the following keybindings:
- modkey + 1-0: Switch to workspace 1-0 on screen 0
- modkey + control + 1-0: Switch to workspace 1-0 on screen 1
- modkey + control + shift + 1-0: Default greedyView behaviour
A more basic version inside the default keybindings would be:
, ((modm .|. controlMask, xK_1), windows (viewOnScreen 0 "1"))
where 0 is the first screen and "1" the workspace with the tag "1".
For detailed instructions on editing your key bindings, see XMonad.Doc.Extending.
:: (WindowSet -> WindowSet) | function to run |
-> Focus | what to do with the focus |
-> ScreenId | screen id |
-> WindowSet | current stack |
-> WindowSet |
Run any function that modifies the stack on a given screen. This function will also need to know which Screen to focus after the function has been run.
A variation of onScreen
which will take any X ()
function and run it
on the given screen.
Warning: This function will change focus even if the function it's supposed
to run doesn't succeed.
Focus data definitions
FocusNew | always focus the new screen |
FocusCurrent | always keep the focus on the current screen |
FocusTag WorkspaceId | always focus tag i on the new stack |
FocusTagVisible WorkspaceId | focus tag i only if workspace with tag i is visible on the old stack |
:: ScreenId | screen id |
-> WorkspaceId | index of the workspace |
-> WindowSet | current stack |
-> WindowSet |
Switch to workspace i
on screen sc
. If i
is visible use view
to
switch focus to the workspace i
.
:: ScreenId | screen id |
-> WorkspaceId | index of the workspace |
-> WindowSet | current stack |
-> WindowSet |
Switch to workspace i
on screen sc
. If i
is visible use greedyView
to switch the current workspace with workspace i
.
:: ScreenId | screen id |
-> WorkspaceId | index of the workspace |
-> WindowSet | current stack |
-> WindowSet |
Switch to workspace i
on screen sc
. If i
is visible do nothing.
:: ScreenId | screen id |
-> WorkspaceId | index of the workspace |
-> WindowSet | current stack |
-> WindowSet |
toggleOrView
as in XMonad.Actions.CycleWS for onScreen
with view
:: ScreenId | screen id |
-> WorkspaceId | index of the workspace |
-> WindowSet | current stack |
-> WindowSet |
toggleOrView
from XMonad.Actions.CycleWS for onScreen
with greedyView