additionalKeys: do two tasks?

hello, I have this in my xmonad rc: `additionalKeys` [ ((mod4Mask, xK_z), spawn "/usr/local/bin/xscreensaver-command -lock") ] that locks the screen with my meta-z and works fine. But I now want to switch to workspace 1 before I lock the screen, no matter what workspace I am in. How can I get additionalKeys to do this compount command? thanks, Alex

On Mon, Aug 26, 2013 at 5:21 PM, Aleksandr Miroslav
`additionalKeys` [ ((mod4Mask, xK_z), spawn "/usr/local/bin/xscreensaver-command -lock") ]
that locks the screen with my meta-z and works fine. But I now want to switch to workspace 1 before I lock the screen, no matter what workspace I am in. How can I get additionalKeys to do this compount command?
As with most things in xmonad, use <+> to combine them. (In this case, >> will also work, as will the equivalent do notation.) windows (W.view "1") <+> spawn "/usr/local/bin/xscreensaver-command -lock" (The above assumes: import qualified XMonad.StackSet as W) -- brandon s allbery kf8nh sine nomine associates allbery.b@gmail.com ballbery@sinenomine.net unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net

On Mon, Aug 26, 2013 at 5:29 PM, Brandon Allbery
As with most things in xmonad, use <+> to combine them. (In this case, >> will also work, as will the equivalent do notation.) windows (W.view "1") <+> spawn "/usr/local/bin/xscreensaver-command -lock" (The above assumes: import qualified XMonad.StackSet as W)
Thank you. That works perfectly. Alex
participants (2)
-
Aleksandr Miroslav
-
Brandon Allbery