
Hi, what about a prompt? A general one, to be use to run internal xmonad command, to run shell commands, or to run ssh, etc... With completions, possibly. This what I'm working to. Some previous Ion3 users will find it similar to some of their memories. It is not finished yet, this is why I'm not sending it as a patch, but I'm almost there. I did not think it was going to take such a long time - 3 days now (well, I'm not only coding, I'm also trying to enjoy my vacation. Lake, mountains, etc....-) But you can have an idea, and hopefully give suggestions too: save the attached file in XMonadContrib as Prompt.hs. Import it from Config.hs and add some key bindings to lunch the prompts. For instance: , ((modMask .|. controlMask, xK_x), xmonadPrompt defaultPromptConfig) , ((modMask .|. controlMask.|. shiftMask, xK_x), shellPrompt defaultPromptConfig) So far only a shell prompt and an internal commands prompt (xmonadPrompt) are provided (and only the first one with - still unusable - completions). Suggestions, patches, good wishes are welcome. Andrea PS: the guys at suckless dot something say that dmenu is less then 500 lines of code. I'm still below 500 too, with all the extra features. Some stuff needs to be added, but there is a lot of stuff we could get rid of. The code could not be so verbose, but that's one of my problems. Not Haskell's.

On 8/1/07, Andrea Rossato
Hi,
what about a prompt? A general one, to be use to run internal xmonad command, to run shell commands, or to run ssh, etc...
With completions, possibly.
It's not exactly the same, but there is my Commands contrib module. --dave -- David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/

On Wed, Aug 01, 2007 at 02:31:50PM -0400, David Glasser wrote:
It's not exactly the same, but there is my Commands contrib module.
well, if you'll have a look you'll see that we are talking about quite different kind of stuff, here. by the way, mine uses yours. andrea

On Wed, Aug 01, 2007 at 08:26:49PM +0200, Andrea Rossato wrote:
Hi,
oops, I forgot to say that it requires readline. So you need to modify xmonad.cabal. Change the build-depends line to: build-depends: base>=2.0, X11>=1.2.1, X11-extras>=0.2, mtl>=1.0,unix>=1.0, readline >= 1.0 Readline comes with the base ghc installation as far as I remember. Ciao Andrea

On Wed, Aug 01, 2007 at 08:26:49PM +0200, Andrea Rossato wrote:
what about a prompt? A general one, to be use to run internal xmonad command, to run shell commands, or to run ssh, etc...
Sounds great, to me. I've wanted something like this, as using dmenu is rather hokey and inflexible (e.g. no possibility of decent completion support). My main hope would be to have good (flexible) completion support, and an easy-to-use API. -- David Roundy Department of Physics Oregon State University

On Wed, Aug 01, 2007 at 01:36:56PM -0700, David Roundy wrote:
My main hope would be to have good (flexible) completion support, and an easy-to-use API.
Well, this is the idea I'm working on. Flexible completion support: basically you'll have to provide our own completion function. I'm going to write some related prompt modules as examples: a shell, an internal command, and an ssh prompt, but I'm jut writing the X support stuff. I hope the API will be extremely easy: a Show instance declaration (for the prompt type) and the completion function. I'll give a String back, the command to be run. The look and feel will be quite similar to the Ion prompt. Default colors will be copied from Tabbed.hs, so your fault. They can be changed, though. Cheers Andrea

On Wednesday 01 August 2007 13:26:49 Andrea Rossato wrote:
Hi,
what about a prompt? A general one, to be use to run internal xmonad command, to run shell commands, or to run ssh, etc...
With completions, possibly.
This what I'm working to. Some previous Ion3 users will find it similar to some of their memories.
It is not finished yet, this is why I'm not sending it as a patch, but I'm almost there. I did not think it was going to take such a long time - 3 days now (well, I'm not only coding, I'm also trying to enjoy my vacation. Lake, mountains, etc....-)
But you can have an idea, and hopefully give suggestions too: save the attached file in XMonadContrib as Prompt.hs.
Import it from Config.hs and add some key bindings to lunch the prompts. For instance:
, ((modMask .|. controlMask, xK_x), xmonadPrompt defaultPromptConfig) , ((modMask .|. controlMask.|. shiftMask, xK_x), shellPrompt defaultPromptConfig)
So far only a shell prompt and an internal commands prompt (xmonadPrompt) are provided (and only the first one with - still unusable - completions).
Suggestions, patches, good wishes are welcome.
Andrea
PS: the guys at suckless dot something say that dmenu is less then 500 lines of code. I'm still below 500 too, with all the extra features. Some stuff needs to be added, but there is a lot of stuff we could get rid of. The code could not be so verbose, but that's one of my problems. Not Haskell's.
I'm excited about this, I'd love to have a prompt with completion that is a bit more extensive than dmenu's. My number one feature request: extensible completion support. This is an interesting problem to consider, which design is best? Infinite, lazily unfolded tries? Eagerly awaiting your patch :), Spencer Janssen
participants (4)
-
Andrea Rossato
-
David Glasser
-
David Roundy
-
Spencer Janssen