diff options
author | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2015-02-04 20:02:04 +0100 |
---|---|---|
committer | Alexander Sulfrian <alexander.sulfrian@fu-berlin.de> | 2015-02-04 20:02:04 +0100 |
commit | c8fe2bb1419960b5d539e73326158d1ee4381e5e (patch) | |
tree | d5bd4462b89b4e628ccdb1e332c8c63c5085ef69 | |
parent | 4237ce690b7f4195b2bd80d6ee646d8ab1201cd1 (diff) | |
download | xmonad-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.hs | 11 |
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) |