From 1a40e23790fe41d3048d841166e17428c7c06644 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Wed, 4 Feb 2015 20:08:57 +0100 Subject: xmonad.hs: Add confirmation to logout. --- xmonad.hs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xmonad.hs b/xmonad.hs index 957c124..1bcb311 100644 --- a/xmonad.hs +++ b/xmonad.hs @@ -65,6 +65,7 @@ import Network.HostName import HistoryGrid import EZConfig import Pass +import qualified Confirm font :: String font = "-*-terminus-medium-r-normal-*-12-*-*-*-*-*-*-*" @@ -215,6 +216,19 @@ historyGridConfig = defaultGSConfig , gs_font = "xft:Droid Sans Mono Slashed-8" } +confirmConfig :: HasColorizer a => GSConfig a +confirmConfig = defaultGSConfig + { gs_cellheight = 150 + , gs_cellwidth = 300 + , gs_cellpadding = 50 + , gs_font = "xft:Droid Sans Mono Slashed Bold-35" + , gs_originFractX = (1/2) + , gs_originFractY = (1/3) + } + +confirm :: String -> X() -> X() +confirm = Confirm.confirm confirmConfig + -- -- Hooks -- @@ -309,7 +323,7 @@ xPropMatches = myKeys c hostname = -- this line is critical to reload config - DON'T REMOVE [ ("M-q", broadcastMessage ReleaseResources >> restart "xmonad" True) - , (shutdownKey, io (exitWith ExitSuccess)) + , (shutdownKey, confirm "Logout?" $ io (exitWith ExitSuccess)) , ("M-S-", spawn term) , ("M-", openLastHistoryGrid historyGridConfig 30) -- cgit v1.2.3