gridmgr is a command line tool which provides keyboard-bindable commands for easy window manipulation in any X11 window manager. Commands include placement of windows into predefined grid layouts, directional selection of adjacent windows, and directional movement of windows to adjacent monitors. This is all accomplished without requiring a full-blown tiling window manager, nor any sort of background process, service, or configuration.
With gridmgr, you gain the organizational strengths of a tiling window manager, without sacrificing the free-form flexibility that you get from a stacking window manager. Or, if you're already using a tiling window manager, it gives you some nice commands for window movement and selection.
Its grid placement functionality behaves similarly to the "Grid" Compiz plugin, but written to use standard APIs supported by nearly all modern window managers. But don't take my word for it...
Video
Click the image to see an example of gridmgr in action:
Playing around with gridmgr on a two-monitor system running Openbox.
Documentation
The best way to learn gridmgr is by experimenting with the available commands. Just run gridmgr with no arguments to see what's available. Here are some commands you can try out:
Example Commands
- gridmgr wleft - Activates the window to the left of the current window. If there's nothing to the left, wrap around and pick something from the far right.
- gridmgr mright - Moves the current window one monitor to the right. If there's no monitor to the right, wrap around and pick the leftmost monitor.
- gridmgr guleft - Moves the current window to the upper left quarter of the screen. Try running guleft repeatedly against the same window and you'll see that it adjusts the window's width.
- gridmgr gleft mup - A compound action which moves the active window one monitor up, then places it on the left half of that monitor.
A note about compound actions: Only one "type" of action will be performed at a time (eg gridmgr mup mup won't work). Also, compound actions are always executed in this order, regardless of the argument order: window selection, monitor movement, grid placement.
Installation
Prerequisites
- g++ 4.4+ or thereabouts (I've been using 4.6 myself)
- CMake 2.6+
- Xlib (libx11-dev)
- Optional: Xinerama (libxinerama-dev), for multi-monitor support.
Getting the Code
Get the latest Source Code from Git.
$ git clone https://git.sr.ht/~nickbp/gridmgr
Building
$ cd gridmgr (where LICENCE is found)
$ mkdir bin
$ cd bin
$ cmake ../src (autodetects Xlib/Xinerama and creates Makefiles)
$ make
That should do it! The gridmgr executable will be found in bin/. Just run gridmgr with no arguments to see the available commands.
The build can optionally be configured with standard CMake tools like "ccmake" and "cmake-gui". They can be used to enable or disable optional components, or to enable a release build by setting CMAKE_BUILD_TYPE to "Release".