3

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?

8

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.

0

I too have searched for this functionality, but, as ianorlin said, it doesn't seem to be possible.

In addition to his/her response, I'd recomend you look into Openbox key chain chroots. This way I was able to extend Lubuntu's default config and add some usefull combos to rearange the windows: while I'm inside the chroot I can make a window size the quarter of the screen and place it in any of the corners: upper left, upper right, etc... you get it.

Check out my -rc.xml file here. Search for the line that says <!-- My custom window controlls chroot -->, currently that is line 333.

0

The solution editing rc.xml is good. Using keyboard to window snapping is very agile.

To enable snap with mouse there is this solution: https://github.com/emilypeto/openbox-window-snap The compilation is easy and after understanding the modifications you can make your adjustments.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.