Tiling windows horizontally and vertically under Lubuntu (LXDE/Openbox)?

Configuration:

Yes, you can achieve this by adding a few custom keyboard shortcuts to your openbox configuration file.

Open your rc.xml variant (e.g. ~/.config/openbox/lxde-rc.xml, ../lubuntu-rc.xml or ../rc.xml) and insert the following snippet within the <keyboard>..</keyboard> section:

<!-- Vertical tiling -->
<keybind key="C-W-v">
  <action name="UnmaximizeFull"/>
  <action name="MoveResizeTo">
    <width>50%</width>
  </action>
  <action name="MaximizeVert"/>
  <action name="MoveResizeTo">
    <x>0</x>
    <y>0</y>
  </action>
  <action name="NextWindow">
    <interactive>no</interactive>
    <dialog>none</dialog>
    <finalactions>
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <width>50%</width>
      </action>
      <action name="MaximizeVert"/>
      <action name="MoveResizeTo">
        <x>-0</x>
        <y>0</y>
      </action>
    </finalactions>
  </action>
</keybind>

<!-- Horizontal tiling -->
<keybind key="C-W-h">
  <action name="UnmaximizeFull"/>
  <action name="MoveResizeTo">
    <height>50%</height>
  </action>
  <action name="MaximizeHorz"/>
  <action name="MoveResizeTo">
    <x>0</x>
    <y>0</y>
  </action>
  <action name="NextWindow">
    <interactive>no</interactive>
    <dialog>none</dialog>
    <finalactions>
      <action name="UnmaximizeFull"/>
      <action name="MoveResizeTo">
        <height>50%</height>
      </action>
      <action name="MaximizeHorz"/>
      <action name="MoveResizeTo">
        <x>0</x>
        <y>-0</y>
      </action>
    </finalactions>
  </action>
</keybind>

<!-- Restore window dimensions -->
<keybind key="C-W-r">
  <action name="UnmaximizeFull"/>
  <action name="NextWindow">
    <interactive>no</interactive>
    <dialog>none</dialog>
    <finalactions>
      <action name="UnmaximizeFull"/>
    </finalactions>
  </action> 
</keybind>

Shortcuts in action:

enter image description here

Usage:

  • Super+Ctrl+V: Tile last active windows vertically
  • Super+Ctrl+H: Tile last active windows horizontally
  • Super+Ctrl+R: Restore original window dimensions

To modify these assignments simply edit the <keybind key="..."> lines in the snippet above.

Notes:

  • This method will only tile the two last active windows
  • You can swap window positions by focussing the inactive window and pressing the hotkey again