Created
August 9, 2021 10:55
-
-
Save henninb/d32dfde84832c53102cf9de85197156f to your computer and use it in GitHub Desktop.
xmonad - name the submap keys
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import qualified XMonad.Util.NamedActions as NamedActions | |
import qualified Data.Map as M | |
keybinds :: XConfig Layout -> [((KeyMask, KeySym), NamedActions.NamedAction)] | |
keybinds conf = let | |
subKeys str ks = NamedActions.subtitle str : mkNamedKeymap conf ks | |
in | |
subKeys "Scratchpads" | |
[ | |
("M-S-o", NamedActions.addName "submap" $ submap . M.fromList $ | |
[ | |
((0, xK_s), namedScratchpadAction scratchPads "spotify-nsp") | |
, ((0, xK_d), namedScratchpadAction scratchPads "discord-nsp") | |
, ((0, xK_t), namedScratchpadAction scratchPads "tmux-nsp") | |
]) | |
] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Replace the plain
submap. M.fromList
bit with the special XMonad.Util.NamedActions.submapName (it already takes a list) to get it to propagate the action descriptions "upwards".https://hackage.haskell.org/package/xmonad-contrib-0.16/docs/XMonad-Util-NamedActions.html#v:submapName