Openbox

From NinjaMonkeys

Jump to: navigation, search

http://icculus.org/openbox/

Faster and more customizable than Compiz.

Default configuration and keybindings

Key and mouse bindings drive actions for maximum power and flexibility.


Shortcut to open a terminal or focus the existing one on your current desktop

Save this as a script somewhere, e.g. /usr/bin/myterm.sh and chmmod +x it.

#!/bin/sh

terminal_wm_class="gnome-terminal"
terminal_exec="gnome-terminal"

# no terminal started, so start one
if [ -z "`wmctrl -lx | grep $terminal_wm_class`" ]; then
    $terminal_exec &
else
    # 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
    else
        # no terminals on current desktop, so just open the first one
        wmctrl -x -a $terminal_wm_class
    fi;
fi;

Change the terminal and wm_class to the one you use. Install wmctrl (available through synaptic on ubuntu).

Then setup a keybinding in the file ~/.config/openbox/rc.xml or wherever it's stored. </pre> <keybind key="A-e">

   <action name="Execute">
       <command>/usr/bin/myterm.sh</command>
   </action>

</keybind> </pre>

Et voila! Every time you press alt-e it will take you to your closest terminal or start a new one.

Personal tools