[openbox] Run dialog

Myles Green rmg57 at telus.net
Tue Jun 13 09:32:56 EDT 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Mon, 12 Jun 2006 01:37:18 +0200 (CEST)
Mikael Magnusson <mangosoft at comhem.se> 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
> 
> now i magically have a run dialog with tab completion, history and ultra 
> fast startup.

This looks totally cool! Thanks for posting it :) I have a couple of
questions regarding the rc.xml bit though: where should it be located? in
~/rc.xml? Should it be named something like ~/zshrunrc.xml? Sorry, my
shell scripting skills are embarrassingly poor :( 

TIA, Myles
- -- 
Sweet sixteen is beautiful Bess,
And her voice is changing -- from "No" to "Yes".
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEjr6Pf8E1+O/Jq5YRAqaCAKCxui+gvaxpSH35fqyqzsO49o0dxgCfSmfv
4205r6PzEr7vRoh1eMQ7/xw=
=vTh5
-----END PGP SIGNATURE-----


More information about the openbox mailing list