How can window snap be enabled in Openbox?

9,687

I know I can do this with keyboard shortcuts, but not with the mouse unfortunately. I do not think the openbox configuration file have support for a "on drag" mouse event.

<keybind key="W-Left">        # HalfLeftScreen
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo"><x>0</x><y>0</y><height>97%</height><width>50%</width></action>
</keybind>
<keybind key="W-Right">       # HalfRightScreen
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo"><x>-0</x><y>0</y><height>97%</height><width>50%</width></action>
</keybind>
<keybind key="W-Up">          # HalfUpperScreen
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo"><x>0</x><y>0</y><width>100%</width><height>50%</height></action>
</keybind>
<keybind key="W-Down">        # HalfLowerScreen
    <action name="UnmaximizeFull"/>
    <action name="MoveResizeTo"><x>0</x><y>-0</y><width>100%</width><height>50%</height></action>
</keybind>

If you want to do this with the mouse it will be a lot more tricky, but openbox does have mousebindings, but it does use the same actions. openbox does not really have a binding for dragging to one half of the screen though, so you will need to trigger it from something else.

Share:
9,687

Related videos on Youtube

d3pd
Author by

d3pd

Updated on September 18, 2022

Comments

  • d3pd
    d3pd over 1 year

    I would like to have window snap behaviour in Openbox. For me, this would mean that dragging a window to the edge of the display using the mouse would change the size of the window such that it is docked in half or quarter of the display, as can be done in Unity7. How can this be done in Openbox?