Clicksnap - snap windows by Ctrl + Shift + click

Update!!!
Script renamed to snapwin, bindings changed to Ctrl + Shift + LeftClick, now can be also invoked by keyboard only.

Hi,
Last evenings I wrote small script which let snap windows by Ctrl + Shift + Click.
See how it works…

This script is already shipped with mabox-tools package so you can try it for yourself.
Add this mousebind action to context Frame in ~/.config/openbox/rc.xml:

  <mousebind action="Press" button="C-S-Left">
    <action name="Execute">
      <command>snapwin</command>
    </action>
  </mousebind>

or update your rc.xml by command:
You may loose your own customization - if any.

mb-reset obrcxml
openbox --reconfigure

Project on github: ( script renamed and is part of upcoming DeskGrid now - this repo will be archived soon)

What do you think? Any feedback welcome :slight_smile:

7 Likes

Glad to see you fixed the overriding of browser tabs. :slight_smile:

1 Like

Hello!.
In my case, it works by clicking on the window’s border, not inside the window.

Hi @Rhuks,
The whole thing changed a little… and is now included in Mabox with latest updates.
If you want to use it, you have to update rc.xml by yourself.
Two options:

mb-reset -c obrcxml

then you have oportunity to see what changed and pick changes one-by-one.
After saving changes run openbox --reconfigure

… or

mb-reset obrcxml

(this will backup your current rc.xml and update it completly with new default one)

After that use:
C-S-LeftMouseButton to place windows by mouse (on the grid)
or C-S - Keypad Number 1 to 9.

Thanks for your prompt answer. I’ve followed your instructions and now it works like a charm.

I have two monitors. When I try to use the click snap feature, for example clicking the center of a window, it centers the window between the two monitors (half the window on each monitor), not on the one that the window was on. Is there a fix for this? This is in Virtualbox if that makes a difference - I’m trying out Mabox before installing on my PC.

No, sorry. It was written for one monitor - the setup I use.

No problem! It’s a cool feature but not a deal breaker if it doesn’t work for my setup. I may stick to a full DE on my PC and install Mabox on my old Thinkpad. Thanks for the reply!

1 Like

really a great work.
i think that it could subsitute the python code actually in use on mabox.

Hi @purpleleaf and welcome to the forum :slight_smile:

I’m working to improve it, and will ship improved version as update soon. And yes the goal is to replace Python Quicktile in future.

Already done, all works like a charm :wink:
I think i will only reduce the dimensions of the central tile.