[openbox] key binding action to focus existing terminal
vaughnd at gmail.com
Tue Apr 22 09:08:55 EDT 2008
What a fantastic little app! Thanks Delcides.
I put together this shell script to do exactly what I need. Funny thing is
that it's _still_ faster than the collection of applescripts I had on my mac
to play/pause itunes, etc. Man I missed this level of power and speed.
# no terminal started, so start one
if [ -z "`wmctrl -lx | grep gnome-terminal`" ]; then
# search for existing terminals on current desktop
current_desk=`wmctrl -d | grep '*' | cut -d ' ' -f 1`
term_on_this_desk=`wmctrl -lx | grep "$current_desk[
]*$terminal_wm_class" | cut -d ' ' -f 1`
if [ -n "$term_on_this_desk" ]; then
wmctrl -i -a $term_on_this_desk
# no terminals on current desktop, so just open the first one we
wmctrl -x -a $terminal_wm_class
On Tue, Apr 22, 2008 at 2:19 PM, Delcides F. Sousa Jr <delcides at gmail.com>
> On Tue, Apr 22, 2008 at 8:42 AM, Vaughn Dickson <vaughnd at gmail.com> wrote:
> > Hi,
> > I'm used to Quicksilver's behaviour on Mac, where opening an
> > will just give it focus if it's already open. Is there a way to do this
> > in openbox? Specifically for a terminal app. I have alt-e bound to open
> > a terminal, but I'd rather have it focus the existing one on my current
> > desktop/workspace.
> > Thanks,
> > Vaughn
> > ---
> > To unsubscribe, send a blank email to openbox-unsubscribe at icculus.org
> > Mailing list archives: http://icculus.org/cgi-bin/ezmlm/ezmlm-cgi?24
> You can use wmctrl and a bit of shell script to do this.
> To unsubscribe, send a blank email to openbox-unsubscribe at icculus.org
> Mailing list archives: http://icculus.org/cgi-bin/ezmlm/ezmlm-cgi?24
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the openbox