diff --git a/src/XMonad/Custom/SystemKeyBindings.hs b/src/XMonad/Custom/SystemKeyBindings.hs new file mode 100644 index 0000000..e891b13 --- /dev/null +++ b/src/XMonad/Custom/SystemKeyBindings.hs @@ -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 = "" + + +i3lock :: X() +i3lock = spawn "i3lock-fancy --pixelate -- maim" + +systemctl :: String -> X() +systemctl cmd = spawn $ "systemctl " ++ cmd diff --git a/xmonad-custom.cabal b/xmonad-custom.cabal index 6f918fe..f6580f9 100644 --- a/xmonad-custom.cabal +++ b/xmonad-custom.cabal @@ -11,6 +11,7 @@ flag pedantic library exposed-modules: XMonad.Custom.BindingUtils XMonad.Custom.BasicKeyBindings + XMonad.Custom.SystemKeyBindings XMonad.Custom.UniversitySetup hs-source-dirs: src ghc-options: -funbox-strict-fields -Wall -Wno-unused-do-bind