How to snap windows?

It’s not necessarily the lack of Compiz (a window manager), but the fact that the window manager (Openbox) is somewhat limited in its abilities, primarily because the author long ago considered it a finished product. It hasn’t seen changes in a long time. Though I’ve seen few bugs in it, it certainly hasn’t kept up with the times. Snapping is a relatively new thing.

That said, there is sort of a way to get at it. Change ~./config/openbox/lxqt-rc.xml so that something like the following is included:

<keybind key="W-Left">
    <action name="UnmaximizeFull"/>
    <action name="MaximizeVert"/>
    <action name="MoveResizeTo">
        <width>50%</width>
    </action>
    <action name="MoveToEdge"><direction>west</direction></action>
</keybind>
<keybind key="W-Right">
    <action name="UnmaximizeFull"/>
    <action name="MaximizeVert"/>
    <action name="MoveResizeTo">
        <width>50%</width>
    </action>
    <action name="MoveToEdge"><direction>east</direction></action>
</keybind>
<keybind key="W-Down">
   <action name="Unmaximize"/>
</keybind>
<keybind key="W-Up">
   <action name="Maximize"/>
</keybind>

That uses the Windows and arrow keys to do the dirty work, but 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.

2 Likes