[openbox] Run dialog

Mikael Magnusson mangosoft at comhem.se
Sun Jun 11 19:37:18 EDT 2006


On Thu, 13 Jan 2005, Md Mooktakim Ahmed wrote:

> I would be very happy if some kind of run dialog box would be integrated into openbox.
> The reason i say this is becuase at the moment i use http://gmrun.sourceforge.net/
> Its great, its absolutely fantastic.
> But there is one little problem that annoys me.
> Its slow.
>
> Openbox is a great WM. One of the biggest reason i use it because its lightning fast.
>
> However, gmrun, being a GTK app its very slow to load up.
>
> I think if a run dialog, much like gmrun, would be integrated into openbox, maybe have
> it loaded in the background ALL the time, then i could have a dialog box that opens up
> instantly when i press my keybinding.
>
> gmrun has a lot of delay the first time i run it. It gets faster after that, however it
> slows even further when there's a lot of load.
>
> I know that the openbox devs feel that its a WM, therefore it doesn't need a run dialog
> box. Some other app will handle it. I appreciate that, i prefer that thinking my self.
> Becuase i use lots of other apps, to make my life in openbox easier, (eg: devils, its a
> fantastic program). But i just cant find a good app that'l replace a good builtin run
> dialog box.
>
> Anyway, just want to see what other people think.

The other week, I wrote a little shellcode and made a keybinding to turn 
my terminal and zsh into the fastest and bestest run dialog ever.
rc.xml:
   <keybind key="W-r">
     <action name="execute"><execute>sh -c 'ZSHRUN=1 urxvt -geometry 100x5+335+446'</execute></action>
   </keybind>

.zshrc:
#change the part where you assign HISTFILE to this
if [[ -n "$ZSHRUN" ]]
then
   HISTFILE=~/.zrunhistory
else
   HISTFILE=~/.history
fi

#put this somewhere
if [[ -n "$ZSHRUN" ]]; then
   unset ZSHRUN
   function _accept_and_quit() {
     zsh -c "${BUFFER}" &|
     exit
   }
   zle -N _accept_and_quit
   bindkey "^M" _accept_and_quit
fi
#if you want to run a command, like cd, without closing the dialog, you 
#can press ctrl-j instead.

#if you have any time consuming commands or ones that print info about new 
#mail etc, wrap them like this:
if [[ ! -n "$ZSHRUN" ]]; then
   echo hi
   PS1=elaborate\ prompt
else
   PS1="zshrun %~> "
fi

now i magically have a run dialog with tab completion, history and ultra 
fast startup.

--
Mikael Magnusson

PS yes i know i am replying to a very old mail.



More information about the openbox mailing list