How to Tile Windows in Lubuntu 19.10 & 20.04 with Missing lxqt-rc.xml

lubuntulxqtopenboxshortcut-keyswindow-manager

Lubuntu 19.10 and 20.04 (LTS) use Openbox as the window manager.

For Lubuntu 18.04 and 19.04, the file that allowed users to edit various Openbox settings, lubuntu-rc.xml and lxqt-rc.xml, respectively, has a section titled "Keybindings for window tiling" with keyboard shortcuts for

  • HalfLeftScreen
  • HalfRightScreen
  • HalfUpperScreen and
  • HalfLowerScreen

That section is missing in ~/.config/openbox/lxqt-rc.xml of Lubuntu 19.10 and 20.04 (LTS).

I followed the instructions in the release notes to delete

  • ~/.config/lxqt/globalkeyshortcuts.conf
  • ~/.config/lxqt/lxqt-runner.conf and
  • ~/.config/openbox/lxqt-rc.xml

and to log out and log back in. However, lxqt-rc.xml still doesn't have the window tiling section.

I understand that there have been some conflicts with how the Super also known as Meta key conflicted somehow with LXQt. (All the window tiling keyboard shortcuts originally used the Super key.)

What can users of Lubuntu 19.10 and 20.04 do to get back "window tiling" keyboard shortcuts?

Best Answer

Edit dated 20200526: thanks to this question, I realized that another solution would be to change the shortcut for showing/hiding the LXQt menu to something like Meta+Space. In other words, if one sets Meta+Space to show/hide LXQt's menu, the "pure" Super is available for use in ~/.config/openbox/lxqt-rc.xml. No need to use the combination of C+W detailed below. Your 18.04 lubuntu-rc.xml will work now in Lubuntu 20.04 (and 19.10).


This answer is applicable to Lubuntu 19.10 and Lubuntu 20.04

And, for clarity, the file used in the Lubuntu session should be ~/.config/openbox/lxqt-rc.xml and that in a pure Openbox session should be named ~/.config/openbox/rc.xml


In How to snap windows?, a member of the Lubuntu team suggests including some code in lxqt-rc.xml to bring back window tiling and also addresses the conflict I mentioned in the question:

... in 19.04+, you’ll run into conflicts with lxqt-globalkeys using the key to open the menu, so either disable that, reconfigure that, or use something other than the Windows key here.

Please look at the keyboard shortcuts section in the manual for Lubuntu 20.04 which has the list of default keyboard shortcuts but also mentions this:

Global-keys will take preference over openbox bindings. If a key is used in Global-keys, it will not work in Openbox keyboard shortcuts. For example if the W(indows) key opens the LXQT application menu (equivilant of the windows start menu) in Global-keys, Openbox commands like window resizing (W + arrow keys) will not work correctly. Keep this in mind when using and editing keyboard shortcuts.


If one wants the same tiling shortcuts that were used in Lubuntu 19.04, here they are in a somewhat modified form. I've included using the Control key together with the Super key and the relevant arrow key instead of just the Super key and the relevant arrow key.

One important point with the keyboard shortcuts listed below is that the user must first press and hold the Ctrl key and then press and hold the Super key and then press the relevant arrow key before releasing all the keys. If the user first presses the Super key first, and then presses the Ctrl key, the shortcuts will not work.

    <!--
        Lubuntu specific.
        Keybindings for window tiling
    -->
    <!--
        # HalfLeftScreen
    -->
  <keybind key="C-W-Left">
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo">
      <x>0</x>
      <y>0</y>
      <height>100%</height>
      <width>50%</width>
    </action>
  </keybind>
    <!--
        # HalfRightScreen
    -->
  <keybind key="C-W-Right">
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo">
      <x>-0</x>
      <y>0</y>
      <height>100%</height>
      <width>50%</width>
    </action>
  </keybind>
    <!--
        # HalfUpperScreen
    -->
  <keybind key="C-W-Up">
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo">
      <x>0</x>
      <y>0</y>
      <width>100%</width>
      <height>50%</height>
    </action>
  </keybind>
    <!--
        # HalfLowerScreen
    -->
  <keybind key="C-W-Down">
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo">
      <x>0</x>
      <y>-0</y>
      <width>100%</width>
      <height>50%</height>
    </action>
  </keybind>

After the edits, open a terminal and run openbox --reconfigure for the keybinding to take effect. Alternatively, log out and log back in.


I didn't include keyboard shortcuts for maximizing or minimizing windows because these actions and many others can easily be accessed by pressing Alt+Spacebar. Note that Openbox prefers to use iconify instead of minimize.