Howto: Windows Agile Snapping

Share your own howto's etc. Not for support questions!

Howto: Windows Agile Snapping

Postby bester69 » 2015-08-30 11:19

Howto to snap windows in an agile way

Image

Movie demo
https://youtu.be/-JxuZTldSpQ

Thouht most of DE's already come up with snapping funtion i find it unfuntional to snap windows by edgeding the mouse against the sides, so the best way to snap the windows is by using hotkeys shortcurts.

Steps:
1- sudo apt-get install wmctrl

2- My proposal --> Create 4 hotkey shortcuts for each function snapping:
2.1--> Snapping to left side (Control+SHIFT+ Left Cursor)
#!/bin/sh
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz &
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$HALF,-1


2.2--> Snapping to right side (Control+SHIFT+ Right Cursor)
#!/bin/sh
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz &
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$HALF,0,$HALF,-1


2.3--> Snapping to Maximum screen (Control+SHIFT+ Up Cursor)
#!/bin/sh
wmctrl -r :ACTIVE: -b add,maximized_vert,maximized_horz


2.4--> Restore Window (Control+SHIFT+ Down Cursor)
#!/bin/sh
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz


I find this proposal really agile and very usefull, i always install wmctrl.


Enjoy :wink:
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1501
Joined: 2015-04-02 13:15

Re: Howto: Windows Agile Snapping

Postby bester69 » 2015-09-07 18:09

bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1501
Joined: 2015-04-02 13:15

Re: Howto: Windows Agile Snapping

Postby bester69 » 2016-07-04 23:47

I'll add two more i also use


2.5--> Snapping to 4/3 left side (Control+SHIFT+ N)
#!/bin/sh
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz &
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,0,0,$(($HALF*4/3)),-1


2.6--> Snapping to 4/3 right side (Control+SHIFT+ M)
#!/bin/sh
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz &
WIDTH=`xdpyinfo | grep 'dimensions:' | cut -f 2 -d ':' | cut -f 1 -d 'x'` && HALF=$(($WIDTH/2)) && wmctrl -r :ACTIVE: -b add,maximized_vert && wmctrl -r :ACTIVE: -e 0,$(($HALF*2/3)),0,$(($HALF*4/3)),-1
bester69 wrote:You wont change my mind when I know Im right, Im not an ...
User avatar
bester69
 
Posts: 1501
Joined: 2015-04-02 13:15


Return to Docs, Howtos, Tips & Tricks

Who is online

Users browsing this forum: No registered users and 2 guests

fashionable