Discussion:
[xmonad] switch workspace on all monitors at once
Kristopher Keller
2015-08-19 04:28:49 UTC
Permalink
Hi, I'm using three monitors and each monitor has 10 workspaces.

This is the code I'm using to switch workspaces:

[code]
myWorkspaces = withScreens 3 ["1","2","3","4","5","6","7","8","9"]

...

[((m .|. modm, k), windows $ onCurrentScreen f i)
| (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
[/code]

I wanted to modify it to add a keybind to switch the workspace on all
three monitors at once. For example, control + modm + 2 would switch all
monitors to workspace 2. But I'm afraid I don't understand whats going
on in that code. Could someone give me a hand?

Kristopher
Brandon Allbery
2015-08-19 14:06:15 UTC
Permalink
Post by Kristopher Keller
Hi, I'm using three monitors and each monitor has 10 workspaces.
[code]
myWorkspaces = withScreens 3 ["1","2","3","4","5","6","7","8","9"]
...
[((m .|. modm, k), windows $ onCurrentScreen f i)
| (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
[/code]
I wanted to modify it to add a keybind to switch the workspace on all
three monitors at once. For example, control + modm + 2 would switch all
monitors to workspace 2. But I'm afraid I don't understand whats going on
in that code. Could someone give me a hand?
You might want to look at
http://xmonad.org/xmonad-docs/xmonad-contrib/XMonad-Actions-DynamicWorkspaceGroups.html
--- unfortunately, it does not look like anyone has provided integration
with IndependentScreens to treat them as predefined groups.
--
brandon s allbery kf8nh sine nomine associates
***@gmail.com ***@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
Allen S. Rout
2015-10-29 18:42:43 UTC
Permalink
Post by Kristopher Keller
Hi, I'm using three monitors and each monitor has 10 workspaces.
[code]
myWorkspaces = withScreens 3 ["1","2","3","4","5","6","7","8","9"]
...
[((m .|. modm, k), windows $ onCurrentScreen f i)
| (i, k) <- zip (workspaces' conf) [xK_1 .. xK_9]
, (f, m) <- [(W.greedyView, 0), (W.shift, shiftMask)]]
[/code]
I wanted to modify it to add a keybind to switch the workspace on all
three monitors at once.
I'm moving workspaces around to different screens all the time, so the
details will be different. But what I'd suggest is that you compose;
just have your key press do "set screen 1 to workspace 1. Set screen 2
to workspace 1. "... etc. Example from my stuff below.



, ((modm .|. shiftMask, xK_s ), do { windows (viewOnScreen 0
"tsmmon" ) >> windows (viewOnScreen 2 "tsmsess" ) } )
, ((modm .|. shiftMask, xK_f ), do { windows (viewOnScreen 0 "dd1" )
Post by Kristopher Keller
windows (viewOnScreen 2 "dd2" ) } )
, ((modm .|. shiftMask, xK_n ), windows (viewOnScreen 0 "mail" ))


, ((modm .|. shiftMask, xK_a ), do { windows (viewOnScreen 0
"tsmmon" ) >>
windows (viewOnScreen 2
"tsmsess" ) >>
windows (viewOnScreen 1 "mail"
) >>
windows (viewOnScreen 3 "web" )
} )

Continue reading on narkive:
Loading...