diff options
-rw-r--r-- | .xmonad/xmonad.hs | 9 |
1 files 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" | |||
195 | 195 | ||
196 | spawnKeychain = do | 196 | spawnKeychain = do |
197 | home <- liftIO getHomeDirectory | 197 | home <- liftIO getHomeDirectory |
198 | let keys = map ((home </>) . ("/.ssh/id_" ++)) ["ed25519", "ecdsa", "rsa"] | 198 | let keys = map ((home </>) . (".ssh/id_" ++)) ["ed25519", "ecdsa", "rsa"] |
199 | keys' <- filterM (liftIO . doesFileExist) keys | 199 | liftIO (maybe (return ()) (setEnv "SSH_ASKPASS") =<< findAskpass) |
200 | safeSpawn "urxvtc" $ ["-title", "keysetup", "-e", "keychain"] ++ keys' | 200 | safeSpawn "keychain" =<< liftIO (filterM doesFileExist keys) |
201 | where | ||
202 | findAskpass = filter `liftM` readFile "/etc/zshrc" | ||
203 | filter = listToMaybe . catMaybes . map (stripPrefix "export SSH_ASKPASS=") . lines | ||
201 | 204 | ||
202 | assimilateKeychain :: X () | 205 | assimilateKeychain :: X () |
203 | assimilateKeychain = liftIO $ assimilateKeychain' >> return () | 206 | assimilateKeychain = liftIO $ assimilateKeychain' >> return () |