Linux Mint Debian MATE Easily Splitting Windows

Posted on by on June 13th, 2013 | 0 Comments »

split_windows

Overview

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.

Installation

 sudo apt-get install wmctrl 

Scripts

Save these scripts somewhere accessible.  For example, my username is slayer, so I can save scripts in a sh directory in my root.
mkdir /home/slayer/sh
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)

#!/bin/bash
wmctrl -r :ACTIVE: -e 0,0,0,960,1080

Full Right (full_right.sh)

#!/bin/bash
wmctrl -r :ACTIVE: -e 0,960,0,960,1080

Top Right (top_right.sh) [Quadrant 1]

#!/bin/bash
wmctrl -r :ACTIVE: -e 0,960,0,960,540

Top Left (top_left.sh) [Quadrant 2]

#!/bin/bash
wmctrl -r :ACTIVE: -e 0,0,0,960,540

Bottom Left (bottom_left.sh) [Quadrant 3]

#!/bin/bash
wmctrl -r :ACTIVE: -e 0,0,540,960,540

Bottom Right (Quadrant 2)

#!/bin/bash
wmctrl -r :ACTIVE: -e 0,960,540,960,540

Configure Shortcuts

1. Go to System >> Preferences >> Keyboard Shortcuts configure_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.

Links

Emacs Paragraph Comments
Export Beautiful PDFs in Emacs

Categorized Under

GNU/LinuxOperating Systems

About Nick Guthrie

» has written 38 posts