
You have two problems. The first is that `$` extends as far as
possible, so `spawn` ends up being grouped with `W.view` instead of
with `windows`; fix this by using explicit parentheses instead of `$`,
that is `windows (W.view "2")`. The second is that the correct
operator to use is either `*>` or `>>`.
Although you will then discover a third problem, which is a race
condition because `spawn` is asynchronous (Linux is not Windows),
meaning sometimes the new window will open on the previously active
workspace. You may want to use
https://hackage.haskell.org/package/xmonad-contrib-0.17.0/docs/XMonad-Action...
instead (don't forget to add
https://hackage.haskell.org/package/xmonad-contrib-0.17.0/docs/XMonad-Action...
to the `manageHook` or it won't work).
On Mon, Jan 17, 2022 at 2:44 PM mito
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
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! _______________________________________________ xmonad mailing list xmonad@haskell.org http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
-- brandon s allbery kf8nh allbery.b@gmail.com