summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2015-09-14 19:59:46 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2015-09-14 19:59:46 +0200
commitc0b549b5775a4c026925795356ce10c6b97c6c5d (patch)
treea1bacace20942041531a6f3010b98101485750ab /lib
parent9734b2f51f9c94ec802820bc57fe50297a5dec77 (diff)
parent1a40e23790fe41d3048d841166e17428c7c06644 (diff)
downloadxmonad-config-c0b549b5775a4c026925795356ce10c6b97c6c5d.tar.gz
xmonad-config-c0b549b5775a4c026925795356ce10c6b97c6c5d.tar.xz
xmonad-config-c0b549b5775a4c026925795356ce10c6b97c6c5d.zip
Merge remote-tracking branch 'origin/master'
* origin/master: xmonad.hs: Add confirmation to logout. xmonad.hs: Do not use M5 on host "Australien" lib/Pass: Code style. lib/Confirm: Add simple confirmation with grid select. shorter xpropmatches Australien does not have a key for mod4 use our font for all prompts add M-M5-q for clean logout remove stuff for taffybar
Diffstat (limited to 'lib')
-rw-r--r--lib/Confirm.hs11
-rw-r--r--lib/Pass.hs7
2 files changed, 16 insertions, 2 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)
diff --git a/lib/Pass.hs b/lib/Pass.hs
index f29df27..c9b70df 100644
--- a/lib/Pass.hs
+++ b/lib/Pass.hs
@@ -1,4 +1,3 @@
-
-----------------------------------------------------------------------------
-- |
-- Module : Pass
@@ -131,7 +130,11 @@ generatePassword passLabel = safeSpawn "pass" ["generate", "--force", passLabel,
getPasswords :: IO [String]
getPasswords = do
home <- getHomeDirectory
- files <- runProcessWithInput "find" [home ++ "/.password-store","-type", "f", "-name", "*.gpg", "-printf", "%P\n"] []
+ files <- runProcessWithInput "find" [
+ home ++ "/.password-store",
+ "-type", "f",
+ "-name", "*.gpg",
+ "-printf", "%P\n"] []
return $ map removeGpgExtension $ lines files
removeGpgExtension :: String -> String