summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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)