summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2015-02-04 20:02:04 +0100
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2015-02-04 20:02:04 +0100
commitc8fe2bb1419960b5d539e73326158d1ee4381e5e (patch)
treed5bd4462b89b4e628ccdb1e332c8c63c5085ef69
parent4237ce690b7f4195b2bd80d6ee646d8ab1201cd1 (diff)
downloadxmonad-config-c8fe2bb1419960b5d539e73326158d1ee4381e5e.tar.gz
xmonad-config-c8fe2bb1419960b5d539e73326158d1ee4381e5e.tar.xz
xmonad-config-c8fe2bb1419960b5d539e73326158d1ee4381e5e.zip
lib/Confirm: Add simple confirmation with grid select.
-rw-r--r--lib/Confirm.hs11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Confirm.hs b/lib/Confirm.hs
new file mode 100644
index 0000000..47e3388
--- /dev/null
+++ b/lib/Confirm.hs
@@ -0,0 +1,11 @@
+module Confirm (confirm) where
+
+import Control.Monad
+
+import XMonad.Core
+import XMonad.Actions.GridSelect
+
+confirm :: GSConfig Bool -> String -> X() -> X()
+confirm config string action = do
+ res <- gridselect config [(string, True), ("No", False)]
+ whenJust res (\x -> when x action)