[xmonad] Repeated presses on Mod - [1..9] to toggle between windows in workspace

Brandon Allbery allbery.b at gmail.com
Sat Sep 2 20:11:31 UTC 2023


In place of `W.greedyView` or `W.view` you would use

`\t ss -> if (W.tag . W.workspace . W.current) ss == t then W.focusUp ss
else W.greedyView t ss`

or define that as a function. Swap `W.greedyView` for `W.view` and/or `
W.focusDown` for `W.focusUp` if you wish.

If you define this as a function (let's say `tagOrFocus`), then the key
definition becomes (assuming `EZConfig`):

           ++
           [ (otherModMasks ++ "M-" ++ key, action tag)
           | (tag, key) <- zip workspacen (words "1 2 3 4 5 6 7 8 9 0 - =
<F1> <F2> <F3> <F4>")
           , (otherModMasks, action) <- [("", windows . tagOrFocus)
                                        ,("S-", windows . W.shift)
                                        ]
           ]

(This is lifted from my own config, adjust as appropriate.)



On Sat, Sep 2, 2023 at 8:08 AM Jean-Baptiste Mestelan <mestelan at gmail.com>
wrote:

> Hello XMonad,
>
> How could one extend the behaviour of Mod - [1..9], so that an initial
> keypress switches to workspace n, but further keypresses toggle between
> windows in that workspace?
> (It is the default behaviour of groups in AutoHotKey, and I must admit it
> has grown on me: it saves one move reaching for Mod-K).
>
> Thanks for any Haskell hints.
>
> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/xmonad
>


-- 
brandon s allbery kf8nh
allbery.b at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/xmonad/attachments/20230902/a1d83ebc/attachment.html>


More information about the xmonad mailing list