diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-09-16 10:21:18 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-09-16 10:21:18 +0200 |
| commit | fb6d9a33c8a7b10557f7119865877f648d8f05da (patch) | |
| tree | 07dc2afefdea417667c2bb8f059a6a3167f19be6 /xmonad.hs | |
| parent | e1f86f92ffcba791739dfea105cb5d8e9081db5e (diff) | |
| parent | cb9e981c80476a7297ecd7c80ba9cd8eafe0f0d1 (diff) | |
| download | dotfiles-fb6d9a33c8a7b10557f7119865877f648d8f05da.tar.gz dotfiles-fb6d9a33c8a7b10557f7119865877f648d8f05da.tar.bz2 dotfiles-fb6d9a33c8a7b10557f7119865877f648d8f05da.zip | |
Merge branch 'master' into carbon
Diffstat (limited to 'xmonad.hs')
| -rw-r--r-- | xmonad.hs | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -1,9 +1,15 @@ +import Control.Monad +import Data.List +import System.Exit + + import XMonad import XMonad.Config.Desktop -- Utilities import XMonad.Util.EZConfig (additionalKeysP, additionalKeys) import XMonad.Util.SpawnOnce +import XMonad.Util.Dmenu -- Layouts import XMonad.Layout.NoBorders @@ -39,8 +45,23 @@ myKeys = [ ("<XF86AudioRaiseVolume>", spawn "~/bin/volume-ctl up") , ("<XF86MonBrightnessUp>", spawn "~/bin/backlight-ctl up") , ("<XF86MonBrightnessDown>", spawn "~/bin/backlight-ctl down") , ("<XF86ScreenSaver>", spawn "slock") + , ("<XF86TouchpadToggle>", spawn "~/bin/touchpad-toggle") , ("M-o", spawn "~/bin/project-open") , ("M-m", spawn "st -e mocp") , ("M-S-d", spawn "notify-send \"$(date +\"%H:%M %A %d/%m/%Y %B\")\"") + , ("M-q", spawn "notify-send Restart" >> spawn restartCmd) + , ("M-S-q", confirm "Are you sure you want to shutdown?" $ io (exitWith ExitSuccess)) ] + +confirm :: String -> X () -> X () +confirm prompt f = do + result <- menuArgs "dmenu" ["-p", prompt] ["yes", "no"] + when (result == "yes") f + +restartCmd :: String +restartCmd = intercalate "; " [ "if type xmonad" + , "then xmonad --recompile && xmonad --restart" + , "else xmessage xmonad not in \\$PATH: \"$PATH\"" + , "fi" + ] |
