[xmonad] Complex hotkeys definition

mito info at mito-space.com
Mon Jan 17 19:43:52 UTC 2022


Dear all,

yet I failed properly occasionally extending "myHotkeys" commands with 
additional arguments, e.g. like also spawning something when switching 
workspaces.

Say, the default is something like:

myHotkeys = [
           ...
           , ("M-2", windows $ W.view "2")
           ...
           ]

for hitting <Super_L+2> for changing to workspace "2".

But what if I wanted to additionally execute some extra command or app – 
such as launching "konsole" (just for testing; I am going to do 
something else)?

Simply editing and adding stuff link

           , ("M-2", windows $ W.view "2" $ spawn "konsole")
or
           , ("M-2", windows $ W.view "2" . spawn "konsole")
or
           , ("M-2", windows $ W.view "2" || spawn "konsole")
or
           , ("M-2", windows $ W.view "2" <+> spawn "konsole")

doesn't work, due to compilation errors.

I am no programmer and haven't yet found the right operators or order; 
or am I missing brackets?
And I don't get the error logs in detail really.

Thanks in advance!


More information about the xmonad mailing list