[xmonad] Re: Issue 393 in xmonad: XMonad.Prompt.Shell should use user-defined searchPredicate

codesite-noreply at google.com codesite-noreply at google.com
Wed Apr 28 10:03:32 EDT 2010


Comment #1 on issue 393 by hgabreu: XMonad.Prompt.Shell should use  
user-defined searchPredicate
http://code.google.com/p/xmonad/issues/detail?id=393

I've managed to set up Shell the way I wanted, which is ignoring case.
It may help anyone willing to correct/enhance XMonad.Prompt.Shell, I don't  
do it
myself because I'm very bad at haskell and don't how to do it right,  
flexible, etc.

I copied X.P.Shell getShellCompl and commandCompletionFunction to my config
(attached) and changed them to this:
getShellCompl cmds s | s == "" || last s == ' ' = return []
                      | otherwise                = do
     f     <- fmap lines $ runProcessWithInput "bash" [] ("bind 'set  
completion-
ignore-case on'; compgen -A file " ++ encodeOutput s ++ "\n")
...the rest of the function is the same...

commandCompletionFunction cmds str | '/' `elem` str = []
                                    | otherwise = filter ((\x y -> map  
toLower x
`isPrefixOf` map toLower y) str) cmds

Oh! I don't think anyone will ever try this config as is, but is one does,  
change the
layoutHook because it won't run ok. I edited MouseResizableTile here to  
play with
SubLayouts.

Attachments:
	xmonad.hs  17.3 KB

--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings


More information about the xmonad mailing list