[xmonad] additionalKeys: do two tasks?

Brandon Allbery allbery.b at gmail.com
Mon Aug 26 23:29:22 CEST 2013


On Mon, Aug 26, 2013 at 5:21 PM, Aleksandr Miroslav
<alexmiroslav at gmail.com>wrote:

> `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 at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/xmonad/attachments/20130826/c26d72a4/attachment.htm>


More information about the xmonad mailing list