I ended up using xcape, a utility designed to do exactly this:
xcape allows you to use a modifier key as another key when pressed and released on its own. Note that it is slightly slower than pressing the original key, because the pressed event does not occur until the key is released.
Quoted from the xcape readme
Using xcape, you can assign the press and release of a modifier key to a different key or even a sequence of keys.
For example, you can assign Super to a placeholder shortcut like ⎈ Ctrl⇧ Shift⎇ Alt SuperD with:
xcape -e 'Super_L=Control_L|Shift_L|Alt_L|Super_L|D'
Now when you press and release Super without pressing any other keys, xcape will send keyboard events simulating presses of ⎈ Ctrl⇧ Shift⎇ Alt SuperD (holding all the modifier keys down as if you pressed them like a shortcut).
If you press Super and another key (or hold Super too long, the default timeout is 500 ms), xcape will pass the keyboard events through as is, without firing extra keys.
If you put the placeholder shortcut in rc.xml
, it will run when Super and only Super is pressed.
<keybind key="C-A-S-W-d">
<action name="Execute">
<command>dmenu_run</command>
</action>
</keybind>
Other shortcuts involving Super will not be affected.
Note that you'll have to run xcape each time you boot, so you may want to put it somewhere like ~/.config/openbox/autostart
where it will be run automatically.
According to this Ubuntu forums post, add the following to your rc.xml file:
Re: window dragging in openbox
I think you would want to change (or add) a mousebind entry to the Mouse section of rc.xml with a different binding. Mine currently says this:
<mousebind button="A-Left" action="Drag">
<action name="Move"/>
</mousebind>
Then you can move windows by dragging them while pressing Alt. To use the Super-drag instead use button="W-Left"
Best Answer
Alt+Space, x is the default shortcut for maximize/unmaximize in most window managers. Does that work?
Or maybe it's Alt+F6 and Alt+F7 as suggested in the Actions Documentation.
If not, you can add a binding using the information in the Openbox Bindings Documentation, but it sounds like you can only set shortcuts for all windows, not just for one program.
In brief, you find your
rc.xml
file, then add something like this in the middle of it:Unless you meant unminimize / restore rather than maximize, i.e. a binding that works even when the window isn't focussed.
In that case, I'd suggest using
xbindkeys
andwmctrl
. You'd have to write a script that runswmctrl
to find theuzbl
window usingwmctrl -l
, then run eitherwmctrl -a <win>
orwmctrl -R <win>
, then add an entry in.xbindkeysrc
to run that script whenever a specific keyboard combination was pressed.