summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2015-02-04 20:08:57 +0100
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2015-02-04 20:08:57 +0100
commit1a40e23790fe41d3048d841166e17428c7c06644 (patch)
treedb853bfd8ece646020a4c09be7e52ce366aa80e3
parent6a1480042a0967498f6135bddb5f47fdd4a80f12 (diff)
downloadxmonad-config-1a40e23790fe41d3048d841166e17428c7c06644.tar.gz
xmonad-config-1a40e23790fe41d3048d841166e17428c7c06644.tar.xz
xmonad-config-1a40e23790fe41d3048d841166e17428c7c06644.zip
xmonad.hs: Add confirmation to logout.
-rw-r--r--xmonad.hs16
1 files changed, 15 insertions, 1 deletions
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-<Return>", spawn term)
, ("M-<Return>", openLastHistoryGrid historyGridConfig 30)