ShellPrompt completion like dmenus

Hi, Is it possible to have ShellPrompt complete like dmenu does? For example if I type "fire" it should also show mozilla-firefox and not only everything starting with fire... . Thanks Tobias

I would add also the following :
could it be possible to have shift-tab to go to the previous entry ?
thanks !
Lobzang.
Quoting Tobias Hauth
Hi,
Is it possible to have ShellPrompt complete like dmenu does? For example if I type "fire" it should also show mozilla-firefox and not only everything starting with fire... .
Thanks Tobias _______________________________________________ Xmonad mailing list Xmonad@haskell.org http://www.haskell.org/mailman/listinfo/xmonad

On Thu, Sep 20, 2007 at 04:06:10PM +0200, lobzang@free.fr wrote:
I would add also the following :
could it be possible to have shift-tab to go to the previous entry ?
thanks !
This is on my TODO list, together with the other editing commands (ctrl-a/e, kill word, etc)... It takes some time. Any help highly appreciated though...;-) Andrea

On 2007.09.20 16:48:55 +0200, Andrea Rossato
On Thu, Sep 20, 2007 at 04:06:10PM +0200, lobzang@free.fr wrote:
I would add also the following :
could it be possible to have shift-tab to go to the previous entry ?
thanks !
This is on my TODO list, together with the other editing commands (ctrl-a/e, kill word, etc)... It takes some time. Any help highly appreciated though...;-)
Andrea
This isn't entirely related, but since people are discussing ShellPrompt... before I switched to ShellPrompt from dmenu, I had this line: prompt :: String -> X () prompt app = spawn (app ++ " `echo " ++ app ++ " | dmenu -fn '9x15bold,xft:Bitstream Vera Sans Mono' -nb black -nf white -sf green -sb black`") It would prompt you for a string and then run the 'app' with that string through use of the pipe; pretty nifty. This was incredibly handy for working with Surfraw's elvi (shell scripts that would open up specified web pages/web searches). I eventually figured I could replace it with: prompt :: String -> X () prompt c = mkXPrompt Shell greenXPConfig getShellCompl foo where foo a = spawn (c ++ " " ++ a) But this strikes me as inelegant. Is there any better way, do you think/. -- gwern Bragg CISE Security Glock submiss Reprieve SEAL beanpole charges nuclear

On Thu, Sep 20, 2007 at 03:03:05PM +0200, Tobias Hauth wrote:
Hi,
Is it possible to have ShellPrompt complete like dmenu does? For example if I type "fire" it should also show mozilla-firefox and not only everything starting with fire... .
Hi, there is a huge difference between dmenu and ShellPrompt, afaik: ShellPrompt gets the completions from bash (or readline in version 0.3), whereas in demnu you need to provide them when launching dmenu, right? Now, having ShellPrompt complete "mozilla-firefox" for "fire" requires loading ALL binaries' names present in you path and search them. While feasible I think it would be just too much resource consuming. BTW you can try it yourself. Attached there's a version of ShellPrompt that does what you want (it doesn't require readline): give it a try and, please, report back you impressions. Andrea

Hi,
Andrea Rossato
On Thu, Sep 20, 2007 at 03:03:05PM +0200, Tobias Hauth wrote:
Hi,
Is it possible to have ShellPrompt complete like dmenu does? For example if I type "fire" it should also show mozilla-firefox and not only everything starting with fire... .
Hi,
there is a huge difference between dmenu and ShellPrompt, afaik: ShellPrompt gets the completions from bash (or readline in version 0.3), whereas in demnu you need to provide them when launching dmenu, right?
Now, having ShellPrompt complete "mozilla-firefox" for "fire" requires loading ALL binaries' names present in you path and search them. While feasible I think it would be just too much resource consuming.
BTW you can try it yourself. Attached there's a version of ShellPrompt that does what you want (it doesn't require readline): give it a try and, please, report back you impressions.
I tried it and I love it. It's much faster than dmenu on my computer and I notice no slowdown on my laptop (1.86 Ghz Centrino). If it is to slow for other computer I propose that at least the .xmonad_history could be used with this kind of completion. Thanks a lot for this patch (I have to learn haskell) Tobias

On Thu, Sep 20, 2007 at 03:03:05PM +0200, Tobias Hauth wrote:
Hi,
Is it possible to have ShellPrompt complete like dmenu does? For example if I type "fire" it should also show mozilla-firefox and not only everything starting with fire... .
Hi, there is a huge difference between dmenu and ShellPrompt, afaik: ShellPrompt gets the completions from bash (or readline in version 0.3), whereas in demnu you need to provide them when launching dmenu, right? Now, having ShellPrompt complete "mozilla-firefox" for "fire" requires loading ALL binaries' names present in you path and search them. While feasible I think it would be just too much resource consuming. BTW you can try it yourself. Attached there's a version of ShellPrompt that does what you want (it doesn't require readline): give it a try and, please, report back you impressions. Andrea

I agree, dmenu is taking too much time loading its list :)
Quoting Andrea Rossato
On Thu, Sep 20, 2007 at 03:03:05PM +0200, Tobias Hauth wrote:
Hi,
Is it possible to have ShellPrompt complete like dmenu does? For example if I type "fire" it should also show mozilla-firefox and not only everything starting with fire... .
Hi,
there is a huge difference between dmenu and ShellPrompt, afaik: ShellPrompt gets the completions from bash (or readline in version 0.3), whereas in demnu you need to provide them when launching dmenu, right?
Now, having ShellPrompt complete "mozilla-firefox" for "fire" requires loading ALL binaries' names present in you path and search them. While feasible I think it would be just too much resource consuming.
BTW you can try it yourself. Attached there's a version of ShellPrompt that does what you want (it doesn't require readline): give it a try and, please, report back you impressions.
Andrea
participants (4)
-
Andrea Rossato
-
Gwern Branwen
-
lobzang@free.fr
-
Tobias Hauth