Re: Run Prompt Rewrite Ideas

2009-06-11 Thread Andrei Thorp
On Wed, Jun 10, 2009 at 4:41 PM, Frank Blendingerf...@intoxicatedmind.net 
wrote:
 Hi.

 On Wed 2009-06-10 10:05, Andrei Thorp gar...@gmail.com proclaimed:
  Just to throw in another idea: let's have something like dmenu[1] in
  awesome. I guess most of you know dmenu, for those who don't: it is a
  standalone multi-purpose bar, used originally in dwm, but often also
  together with other tiled WMs like XMonad or awesome. It is actually
  quite the opposite of something like Gnome-do, it is very simplistic -
  you just provide a list of input lines on stdin, and receive the user
  selection on stdout.

 I don't really see the purpose of using dmenu with awesome since
 awesome's panels support pretty much everything that dmenu does
 (including getting stuff from console via awesome-client). Our panels
 are _more_ powerful if anything.

 Could could give me some hints on how to achieve dmenu-like behaviour?
 I admit I have never actually tried to get it done with awesome's
 prompts, as dmenu just worked out of the box.

 I would like a full width bar, split into input area and available
 items. This would probably best done by creating a floating wibox that
 is positioned right over the main statusbar, with a prompt widget and a
 textbox widget. So no problem so far.

Sure I guess, I'll explain how this could roughly be done.

a) If you want a floating wibox positioned wherever, you'd probably
want some code like this in your wibox creation loop (this can be done
for all screens):
runwibox = {}
(loop starts)
(some other code)
-- Run Wibox
runwibox[s] = awful.wibox({
position = float,
fg = beautiful.fg_normal,
bg = beautiful.bg_normal,
border_width = 1,
border_color = beautiful.bg_focus,
screen = s
})
runwibox[s]:geometry({
width = screen[s].geometry.width * 0.6,
height = 22,
x = screen[s].geometry.x + screen[s].geometry.width * 0.2,
y = screen[s].geometry.y + screen[s].geometry.height - 22,
})
runwibox[s].opacity = 0.7
runwibox[s].visible = false
runwibox[s].ontop = true

-- Widgets for prompt wibox
runwibox[s].widgets = {
mypromptbox[s],
}
(loop ends)

b) You want to make some widgets up top, probably text areas, but
images and buttons and whatever you want are also possible with
awesome:
-- External scripts change this
random_text = widget({
type = textbox,
name = random_text,
align = right
})
random_text.text = 
-- This code would probably go above the wibox creation, with your
other widgets code

c) Remember to add the random_text widget to your new floating wibox

d) When you want to change the text of the random_text widget from
outside awesome (ie. with bash scripts), use:
Longbow.garoth ~: echo 'random_text.text = foo bar' | awesome-client

e) To see the value, use:
Longbow.garoth ~: echo return random_text.text | awesome-client
   string foo bar

END OF DEMO

Anyway, so you hopefully get the idea of what I'm doing here. You make
a wibox with whatever widgets you want, and then you can modify the
text of them later, externally, using awesome-client. Awesome-client
can do any lua code, so it's _very_ powerful and really only limited
by your imagination. You can probably make automatically generated
menus, popups, changing images, etc. If you want more text widgets,
make more. It's simple.

 However, yeah, narrowing search is one of those things that would be
 good to have for our run prompt rewrite.

 This is actually the best thing about dmenu, and I guess it would be
 quite a lot of work that has to be done to achieve that. A key handler
 would have to update the item list on every key press, both to narrow
 down the list and for a selection/scrolling support as dmenu has it.

 Is that (currently) doable in Lua? Or would it need work in the C core?

It seems like all the infrastructure is in place, we have a robust
keygrabber and the run system itself is pretty good as it is. Would
take more work of course.

Cheers,

-AT

-- 
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.


Run Prompt Rewrite Ideas

2009-06-10 Thread Andrei Thorp
Hello there,

So we were talking yesterday about the Run prompt. In general, it's a
nice thing, nothing really to complain about. It does tab completion
and history, and that's cool.

But have you guys ever tried something like gnome-do or other run
prompts for Linux? They've come up with a whole lot of cool features.
Examples:
 - Remembering which programs you run most so to offer completion
faster and more accurately
 - Handling mime-types -- so just typing in a txt file might be hooked
to open a terminal with vim
 - Generic handlers -- typing some special command might trigger an
awesome action
 - Mail handlers -- Typing in a mail address could be tab-completed
against some file (often integrates with evolution/thunderbird, but I
guess most of us would use something else). Then pressing enter on a
mail address could open up a compose window in your favourite mail
program, be it Mutt, GMail, Sup, Pine, etc.
 - SSH handlers -- Some people have written separate prompts for this
fairly well -- type one of the hosts in your ssh file for completions
and it opens your term + ssh there

Partial credit to anrxc for ideas. He also said something like, Would
be cool to make the run prompt one of the killer features of Awesome
that now people can't live without -- like Naughty.. I tend to agree,
we could do something spectacular here.

Something that comes to mind here also is that most of the features
I've mentioned above can actually be done with the current system by
making several different prompts that handle things differently and
then pressing that specific bind. This is okay, but it means you need
like 6 different binds rather than a smart system. I'm sure the code
that we have now is reusable to some degree though.

Anyway, so of course me being Garoth the lazy whimp, I don't really
plan to do an undertaking of this magnitude at the moment. I'm not
even suggesting someone should take it, but I think it's worth putting
ideas out there in case someone is indeed intrigued.

Cheers!

-Andrei Garoth Thorp

-- 
To unsubscribe, send mail to awesome-devel-unsubscr...@naquadah.org.


Re: Run Prompt Rewrite Ideas

2009-06-10 Thread Julien Danjou
At 1244633771 time_t, Andrei Thorp wrote:
 Partial credit to anrxc for ideas. He also said something like, Would
 be cool to make the run prompt one of the killer features of Awesome
 that now people can't live without -- like Naughty.. I tend to agree,
 we could do something spectacular here.

I agree, everything is ready to write such a thing.
But that's a big nice work to do. I'll be glad to provide insights to
anyone wanting to work on this, as usual.

 Something that comes to mind here also is that most of the features
 I've mentioned above can actually be done with the current system by
 making several different prompts that handle things differently and
 then pressing that specific bind. This is okay, but it means you need
 like 6 different binds rather than a smart system. I'm sure the code
 that we have now is reusable to some degree though.

awful's prompt stuff is easily reusable. Anybody can write a new module
to write something GNOME Do style.

Cheers,
-- 
Julien Danjou
// ᐰ jul...@danjou.info   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// Trust no one.


signature.asc
Description: Digital signature


Re: Run Prompt Rewrite Ideas

2009-06-10 Thread Frank Blendinger
Hi.

On Wed 2009-06-10 04:36, Andrei Thorp gar...@gmail.com proclaimed:
 So we were talking yesterday about the Run prompt. In general, it's a
 nice thing, nothing really to complain about. It does tab completion
 and history, and that's cool.
 [...]
 Partial credit to anrxc for ideas. He also said something like, Would
 be cool to make the run prompt one of the killer features of Awesome
 that now people can't live without -- like Naughty.. I tend to agree,
 we could do something spectacular here.

Just to throw in another idea: let's have something like dmenu[1] in
awesome. I guess most of you know dmenu, for those who don't: it is a
standalone multi-purpose bar, used originally in dwm, but often also
together with other tiled WMs like XMonad or awesome. It is actually
quite the opposite of something like Gnome-do, it is very simplistic -
you just provide a list of input lines on stdin, and receive the user
selection on stdout.

The reasons I like it and use it together with awesome are:

- It is not a tiny prompt somewhere in a cluttered bar, but occupies
  the whole screen width, hiding the awesome bar underneath it. This
  gives place to show the available items on the right side, and you
  have no distraction.

- vim-like keybindings

- It does the selection of the items by a substring search,
  narrowing the matching items down in real time. And it does this
  fucking fast. I also find this to be more convenient and easier
  then the front-part completion + tabbing that you usually have,
  like in the current awesome prompt or in most shells.

What I don't like that much, is:

- I have to spawn a process every time. It is very fast and has a
  small memory footprint, but nevertheless, having it in Lua would
  let me sleep better at night. ;-)

- The whole integration into awesome is sort of hackish. One example
  for that is that I had to patch dmenu to support x/y offsets, so I
  could use the screen paddings I have set in awesome on my media
  player machine (I need the padding to compensate overscan there).

- The fonts. While awesome uses fonts like Terminus 12 (Xft?),
  dmenu uses those -*-terminus-*-*-...-12-...-*-* fonts, whatever
  those are called. I don't have a clue about fonts under X, but
  those two systems have different fonts available - at least on
  my machines, which make it impossible for me to have the same font
  on the awesome status bar and on my dmenu bars. This clearly
  sucks.


Greetings,
Frank


[1] http://tools.suckless.org/dmenu

-- 
Frank Blendinger | fb(at)intoxicatedmind.net | GPG: 0x0BF2FE7A
Fingerprint: BB64 F2B8 DFD8 BF90 0F2E 892B 72CF 7A41 0BF2 FE7A


signature.asc
Description: Digital signature