add system key bindings

This commit is contained in:
Maximilian Keßler 2022-07-16 14:22:04 +02:00
parent 5be89b24e1
commit a7c09f875e
2 changed files with 25 additions and 0 deletions

View file

@ -0,0 +1,24 @@
module XMonad.Custom.SystemKeyBindings (mySystemKeyBindings) where
import XMonad
import XMonad.Custom.BindingUtils
mySystemKeyBindings :: [([Char], X ())]
mySystemKeyBindings = addSubMapKey mySystemKey $ [
("p", spawn "poweroff"),
("r", systemctl "reboot"),
("l", i3lock),
("s", i3lock <+> systemctl "suspend"),
("h", i3lock <+> systemctl "hibernate"),
("t", i3lock <+> systemctl "hybrid-sleep")
]
where
mySystemKey = "<Escape>"
i3lock :: X()
i3lock = spawn "i3lock-fancy --pixelate -- maim"
systemctl :: String -> X()
systemctl cmd = spawn $ "systemctl " ++ cmd

View file

@ -11,6 +11,7 @@ flag pedantic
library library
exposed-modules: XMonad.Custom.BindingUtils exposed-modules: XMonad.Custom.BindingUtils
XMonad.Custom.BasicKeyBindings XMonad.Custom.BasicKeyBindings
XMonad.Custom.SystemKeyBindings
XMonad.Custom.UniversitySetup XMonad.Custom.UniversitySetup
hs-source-dirs: src hs-source-dirs: src
ghc-options: -funbox-strict-fields -Wall -Wno-unused-do-bind ghc-options: -funbox-strict-fields -Wall -Wno-unused-do-bind