Custom Window Snap
Many desktop environments for Linux have had window snapping (a.k.a window tiling or edge snapping) for a long time. It is a feature that I use very heavily, especially with hotkeys. I have been very dissatisfied with the way Linux desktop environments have handled this. They almost work the way I want, but not quite. I decided to take control of this.
Gosnap stands for "Good Old Snap" and replaces the window snapping/tiling feature on just about any Linux distro that uses the X Window System.
Download:
| Filename | Description | Size | Modified | Link |
|---|---|---|---|---|
|
gosnap |
The Gosnap bash script. | 6.4K | 7/31/2020 |
Installing:
wget https://beardedmaker.com/wiki/files/gosnap
chmod a+x gosnap
sudo cp gosnap /usr/binUsage:
Usage: gosnap [-L | -l | -R | -r | -M | -m | -N | -n | -d | -i]
-L snap left
-l snap left dynamically
-R snap right
-r snap right dynamically
-M maximize window
-m toggle maximize window
-N minimize window
-n minimize window dynamically
-d resize to default geometry (current default: 0,10,60,826,556
-i print window informationIf your desktop environment supports custom hotkeys, you can simply map any hotkey you want to execute this script with the appropriate parameter. For example:
- Snap Left:
gosnap -lSuper+Left - Snap Right:
gosnap -rSuper+Right - Snap Maximize:
gosnap -mSuper+Up - Snap Minimize:
gosnap -lSuper+Down
Note: To "snap dynamically" means to go to an intermediate position depending on the window's current position. For example, if I minimize the window using gosnap -n, but the window was previously maximized, I'd rather the window pop into the middle of the screen on the first invocation, and then when I minimize again I want the window to collapse to the taskbar. To just immediately minimize the window, use gosnap -N instead.