[openbox] Run dialog

Mikael Magnusson mangosoft at comhem.se
Mon Jun 12 16:08:11 EDT 2006


On Mon, 12 Jun 2006, Rafal Muzylo wrote:

> On Mon, Jun 12, 2006 at 01:37:18AM +0200, Mikael Magnusson wrote:
>> 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
>>
> Are there any major changes needed, if you want to use that with bash,
> cause I'm using gmrun too, and though the slow part I can handle, it's
> something else that is a problem. I often need to run a program with
> some shell variable set (most often it's LD_LIBRARY_PATH), and gmrum
> does not allow it. BTW. I'm using urxvt too (like it, too).

I suppose the bindkey part needs replacing, but not sure how to do that in 
bash.

--
Mikael Magnusson



More information about the openbox mailing list