Skip to content

Instantly share code, notes, and snippets.

@frankitox
Last active November 8, 2023 15:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frankitox/2be10331f8e9d5abe89de2a8008aea58 to your computer and use it in GitHub Desktop.
Save frankitox/2be10331f8e9d5abe89de2a8008aea58 to your computer and use it in GitHub Desktop.
For anyone looking to map the workspaces 1-9 to use shortcuts in a grid (1, 2, 3 | q, w, e | a, s, d)
import XMonad (def, modMask, mod4Mask, xK_q, xK_w, xK_e, xK_a, xK_s, xK_d, borderWidth, layoutHook)
import XMonad.Main (xmonad)
import XMonad.Layout.Grid
import XMonad.Util.EZConfig (additionalKeys)
import XMonad.Util.PureX (defile, greedyView)
-- https://hoogle.haskell.org/
winKey = mod4Mask
main :: IO ()
main = xmonad $ def
{ modMask = winKey
, borderWidth = 0
, layoutHook = Grid}
`additionalKeys`
[
((winKey, xK_q), defile (greedyView "4")),
((winKey, xK_w), defile (greedyView "5")),
((winKey, xK_e), defile (greedyView "6")),
((winKey, xK_a), defile (greedyView "7")),
((winKey, xK_s), defile (greedyView "8")),
((winKey, xK_d), defile (greedyView "9"))
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment