From 21d47dd6d13ee7dd2feea5e55f781cf788022b61 Mon Sep 17 00:00:00 2001 From: Gregor Kleen Date: Fri, 25 Dec 2015 14:43:13 +0000 Subject: Fixed keychain --- .xmonad/xmonad.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.xmonad/xmonad.hs b/.xmonad/xmonad.hs index 9bd67b2..8a55674 100644 --- a/.xmonad/xmonad.hs +++ b/.xmonad/xmonad.hs @@ -195,9 +195,12 @@ autostart = [ spawnOnce "urxvtd -o" spawnKeychain = do home <- liftIO getHomeDirectory - let keys = map ((home ) . ("/.ssh/id_" ++)) ["ed25519", "ecdsa", "rsa"] - keys' <- filterM (liftIO . doesFileExist) keys - safeSpawn "urxvtc" $ ["-title", "keysetup", "-e", "keychain"] ++ keys' + let keys = map ((home ) . (".ssh/id_" ++)) ["ed25519", "ecdsa", "rsa"] + liftIO (maybe (return ()) (setEnv "SSH_ASKPASS") =<< findAskpass) + safeSpawn "keychain" =<< liftIO (filterM doesFileExist keys) + where + findAskpass = filter `liftM` readFile "/etc/zshrc" + filter = listToMaybe . catMaybes . map (stripPrefix "export SSH_ASKPASS=") . lines assimilateKeychain :: X () assimilateKeychain = liftIO $ assimilateKeychain' >> return () -- cgit v1.2.3