1. -- Named Scratchpads
  2. scratchpads :: [NamedScratchpad]
  3. scratchpads = [ NS "terminal"
  4. ("alacritty --class \"Alacritty\",\"scratchTerm\")
  5. (appName =? "scratchTerm")
  6. (topFloat (9/10) (5/8))
  7. , NS "emacs"
  8. ("emacsclient -c -a 'emacs' --frame-parameters='(quote (name . \"scratchmacs\"))'")
  9. (appName =? "scratchmacs")
  10. (centerFloat (3/4) (3/4))
  11. ]
  12. where
  13. centerFloat w h = customFloating $ W.RationalRect ((1-w)/2) ((1-h)/2) w h
  14. topFloat w h = customFloating $ W.RationalRect ((1-w)/2) 0 w h
  15. -- Set _WM_ClASS if needed
  16. myTerminal :: Maybe String -> String
  17. myTerminal Nothing = "alacritty"
  18. myTerminal (Just s) = "alacritty --class \"Alacritty\",\"" ++ s ++ "\""
  19. -- Make Emacs keybindings easier to type
  20. myEmacs :: String
  21. myEmacs = "emacsclient -c -a 'emacs'"
  22. -- Keymap
  23. -- I use additionalKeysP later on
  24. myKeys :: [(String, X ())]
  25. myKeys =
  26. -- Scratchpads
  27. [ ("M-z", namedScratchpadAction scratchpads "terminal")
  28. , ("M-x", namedScratchpadAction scratchpads "emacs")
  29. ]