The missing i3 features

I love the i3 window manager, but it’s missing specific features. This is my attempt to make it perfect.

Integration with Mate

I’ve found that combining Mate and i3 gives me the best of all worlds - a simple but fully featured desktop with the amazing window management of i3. It’s really easy to set up and the process is covered in this blog post.

Moving floating windows to screen edges

i3 supports moving windows to center of the screen, but not to the edges. This requires calculating the screen dimensions and the window dimensions.

This script will move the active floating window to one of the screen edges (the only parameter it requires). Note that it needs the xdotool utility.

Put it somewhere in your PATH (or give the full path to it in the i3 config file).

And here is a config example:

bindsym $mod+Shift+h move left; exec left
bindsym $mod+Shift+j move down; exec down
bindsym $mod+Shift+k move up; exec up
bindsym $mod+Shift+l move right; exec right

(The ‘move direction;’ statements at the beginning are for simultaneously still allow moving of non-floating windows)

Moving all the floating windows to screen edges

Sometimes you’d might want to move all the floating windows out of the way.

For this, I wrote another script (it’s using the one in the previous section, so you’ll need both of them).

Notice that the script will resize the width of the windows to 50%. This is convenient to me because I always have two panes of windows side-by-side. If you don’t need that, remove the section in lines 13-15 (if - export - fi).

An example configuration:

bindsym $mod+Ctrl+h exec left
bindsym $mod+Ctrl+j exec down
bindsym $mod+Ctrl+k exec up
bindsym $mod+Ctrl+l exec right
bindsym $mod+Ctrl+c exec center

Moving the mouse to the center of current window

Whenever I’m hopping around workspaces and windows, I’ve found it more convenient to expect the mouse pointer to always be in the center of the active window. To achieve this, we need to set a variable with script in it and call it whenever there is a switch.

So first set the variable:

set $movemouse "bash -c 'eval `xdotool getactivewindow getwindowgeometry --shell`; [ x$X != x ] && xdotool mousemove $((X+WIDTH/2)) $((Y+HEIGHT/2))'"

And then call it every time you need, for example:

bindsym $mod+1 workspace $ws1; exec $movemouse

Feel free to drop me a mail if you have any thoughts or ideas.