diff options
author | gwern0 <gwern0@gmail.com> | 2007-10-19 20:12:55 +0200 |
---|---|---|
committer | gwern0 <gwern0@gmail.com> | 2007-10-19 20:12:55 +0200 |
commit | 1dedda08b5bb86fc4ade65763d0acc5695a811c9 (patch) | |
tree | 5584814f68ae6dce40837c0b7586fa4b71e05986 | |
parent | fe50466222abce5847e3524964634de2f7b99a0d (diff) | |
download | XMonadContrib-1dedda08b5bb86fc4ade65763d0acc5695a811c9.tar.gz XMonadContrib-1dedda08b5bb86fc4ade65763d0acc5695a811c9.tar.xz XMonadContrib-1dedda08b5bb86fc4ade65763d0acc5695a811c9.zip |
SshPrompt.hs: fmt imports and update
darcs-hash:20071019181255-f7719-e93b15b811ee1f24b3db7e0437f4b3eb83d3c381.gz
-rw-r--r-- | SshPrompt.hs | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/SshPrompt.hs b/SshPrompt.hs index 5ff966b..c0f13ea 100644 --- a/SshPrompt.hs +++ b/SshPrompt.hs @@ -3,7 +3,7 @@ -- Module : XMonadContrib.SshPrompt -- Copyright : (C) 2007 Andrea Rossato -- License : BSD3 --- +-- -- Maintainer : andrea.rossato@unibz.it -- Stability : unstable -- Portability : unportable @@ -18,16 +18,16 @@ module XMonadContrib.SshPrompt ( sshPrompt ) where -import XMonad -import XMonadContrib.XPrompt -import XMonadContrib.Run - -import Control.Monad -import System.Directory -import System.Environment -import Data.List -import Data.Maybe - +import System.Environment (getEnv) +import XMonadContrib.ShellPrompt (runInXTerm) +import Control.Monad(Monad (return), Functor(..), liftM2, mapM) +import Data.List ((++), concat, filter, map, words, lines, takeWhile, take, nub, + sort) +import Data.Maybe (Maybe(..), catMaybes) +import System.Directory (doesFileExist) +import XMonad (X, io) +import XMonadContrib.XPrompt (XPrompt(..), XPConfig, mkXPrompt, + mkComplFunFromList) -- $usage -- 1. In Config.hs add: -- @@ -57,13 +57,13 @@ ssh :: String -> X () ssh s = runInXTerm ("ssh " ++ s) sshComplList :: IO [String] -sshComplList = (nub . sort) `fmap` liftM2 (++) sshComplListLocal sshComplListGlobal +sshComplList = (nub . sort) `fmap` liftM2 (++) sshComplListLocal sshComplListGlobal sshComplListLocal :: IO [String] sshComplListLocal = do h <- getEnv "HOME" sshComplListFile $ h ++ "/.ssh/known_hosts" - + sshComplListGlobal :: IO [String] sshComplListGlobal = do env <- getEnv "SSH_KNOWN_HOSTS" `catch` (\_ -> return "/nonexistent") |