Linux Mint Debian MATE Easily Splitting Windows
While multitasking on my computer, I often want to split windows up on my screen. Â Ideally I want to either make a window take up the left half, or right half, or I want to split it in one of the quadrants. Â An easy way to do that in mate is to use the program wmctrl, write a few simple bash scripts, and configure shortcuts.
Â sudo apt-get install wmctrl
Save these scripts somewhere accessible. Â For example, my username is slayer, so I can save scripts in a sh directory in my root.
You will need to replace my variables if your screen size is not 1920x1080.
- Replace 1080 with your full screen size height
- Replace 960 with half your window width
- Replace 540 with half your window height
Full Left (full_left.sh)
wmctrl -r :ACTIVE: -e 0,0,0,960,1080
Full Right (full_right.sh)
wmctrl -r :ACTIVE: -e 0,960,0,960,1080
Top Right (top_right.sh) [Quadrant 1]
wmctrl -r :ACTIVE: -e 0,960,0,960,540
Top Left (top_left.sh) [Quadrant 2]
wmctrl -r :ACTIVE: -e 0,0,0,960,540
Bottom Left (bottom_left.sh) [Quadrant 3]
wmctrl -r :ACTIVE: -e 0,0,540,960,540
Bottom Right (Quadrant 2)
wmctrl -r :ACTIVE: -e 0,960,540,960,540
1. Go to System >> Preferences >> Keyboard Shortcuts
2. Click Add
3. For each window shortcut, name it something, and select the full path (ie /home/slayer/sh/full_left.sh)
4. Click on the newly made shortcut and give it a keybinding. Â I prefer to use the Windows key (aka Mod4) with a modifier.
- Mod4 + Left = Full Left
- Mod4 + Â Right = Full Right
- Mod4 + Â 1 = Quadrant 1 (aka Top Right)
- Mod4 + Â 2 = Quadrant 2 (aka Top Left)
- Mod4 + Â 3 = Quadrant 3 (aka Bottom Left)
- Mod4 + Â 4 = Quadrant 4 (aka Bottom Right)
Now I can easily position windows using (Mod4) + ( Left | Right | 1 | 2 | 3 | 4 ), which is exactly the functionality I am looking for.