From 1dedda08b5bb86fc4ade65763d0acc5695a811c9 Mon Sep 17 00:00:00 2001 From: gwern0 Date: Fri, 19 Oct 2007 20:12:55 +0200 Subject: SshPrompt.hs: fmt imports and update darcs-hash:20071019181255-f7719-e93b15b811ee1f24b3db7e0437f4b3eb83d3c381.gz --- SshPrompt.hs | 26 +++++++++++++------------- 1 file 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") -- cgit v1.2.3