Keyboard-driven Window Tiling for your existing X11 window manager
- An X11-based desktop (The code expects NETWM hints and X11-style window decorations)
- Python 2.x (Tested with 2.5 on 2011-09-10. Developed on 2.7)
- PyGTK 2.2 (assuming
get_active_window()isn't newer than that)
python-xlib(optional, required for key-binding)
dbus-python(optional, required for D-Bus service)
As PyGTK was never ported to Python 3.x and porting to GTK+ 3.x wouldn't bring any significant benefits for a utility that is fundamentally incompatible with Wayland's security model, these requirements are unlikely to change.
Depending on the distro you are using, you may be able to use one of the following commands to easily install them:
Debian and derivatives (Ubuntu, Mint, etc.):
sudo apt-get install python python-gtk2 python-xlib python-dbus python-wnck
Fedora 22 and above:
sudo dnf install python pygtk2 pygobject2 dbus-python gnome-python2-libwnck
Fedora 21 and below:
sudo yum install python pygtk2 pygobject2 dbus-python gnome-python2-libwnck
Installation (Typical Use)
- Make sure the requirements above are satisfied (including
quicktile.pyto wherever you want to keep it
quicktile.pyto be executable if it isn't already
quicktile.pyonce to generate your configuration file
~/.config/quicktile.cfgto customize your keybinds
- Set your desktop to run
Note: Customizing the available window shapes currently requires editing
the source code (though it's quite simple). This will be remedied when the
author has time to decide between extending the standard Python rcfile parser
Note: If you want to install QuickTile system-wide and have it auto-start,
sudo ./setup.py install command should do the trick. Please
let me know if you experience any troubles.
- If you are running a desktop which uses Compiz (such as Ubuntu's Unity), make sure you've used CCSM to disable the grid plugin or the fight between it and QuickTile for the same type of functionality may cause unpredictable problems.
- Some systems may not provide a Python 2.x binary under the name
python2. If this is the case on yours, you must edit the first line in
- If you are running quicktile from a folder that isn't in your
PATH, you will need to specify a path like
- If you don't mark
quicktile.pyas executable, you must run
python2 quicktile.pyrather than
- You can list your current keybindings by running
- You can get a list of valid actions for the configuration file by running
Usage (Typical Use)
- Focus the window you want to tile
- Hold the modifiers defined in
- Repeatedly press one of the defined keybindings to cycle through window sizes available at the desired location on the screen.
The default keybindings are:
9on the numeric keypad represent regions of your screen
0on the numeric keypad will fully maximize the active window.
Vwill maximize a window horizontally or vertically.
Enteron the numeric keypad will cycle the active window to the next monitor.
This works best when combined with functionality your existing window manager
Alt+Tab) to minimize the need to switch your hand between your
keyboard and your mouse.
ModMask field and the
[keys] section use GTK+ accelerator
syntax and you can use modifier keys in both places. (
ModMask is prepended
[keys] value before parsing it.)
GTK+ modifier syntax looks like this:
The important things to keep in mind for using it are:
- Do not put any spaces inside your keybind string.
- Modifier names and non-modifier key names are not the same thing.
- Modifier names are case-insensitive.
- Key names like
Downare case-sensitive. (Don't let the letter keys fool you. Those work the way they do because
aare two separate names for the same key.)
Valid Key Names
GTK+ key names are just X11 key symbols so the simplest way to identify the
name for a key is to use the
xev command. Just run it in a terminal and
press the key you want. It will print out something like this:
The part I've bolded is the name QuickTile expects.
- If nothing happens, make sure the
xevwindow (and not the terminal) has focus.
- If pressing the key triggers some messages but you do not see one which says
KeyPress event, it's likely that some other program has already grabbed that key combination.
Also, in my testing, QuickTile currently fails to bind keys like
(left Windows key) when they've been configured as modifiers. I'll look into
this as time permits.
Valid Modifier Names
I haven't found a comprehensive document listing the modifier names
gtk.accelerator_parse() accepts, but here are the names I'm aware of with
- Mappings that should be consistent across pretty much any system:
- Mappings which worked for me but I can't make any guarantees for:
- Windows Key:
- Windows Key:
- Mappings which are possible but need to be manually set up using
<Mod3>(I redefined Caps Lock as
Hyper_Land bound it to this)
- Modifiers which cause QuickTile to error out deep in
python-xlibbecause GTK+ maps them to integers beyond the limits of the X11 wire protocol:
- If you want to trigger QuickTile from another application in an efficient
manner, make sure you have
dbus-pythoninstalled and read up on how to send D-Bus messages using either your language's D-Bus bindings or the
- If, for some reason, you want scripted tiling without D-Bus, you can also
run commands like
quicktile.py top-leftbut it may be slower as quicktile has to start, perform an action, and then quit every time you call it.
As with the built-in keybinding, requesting the same action more than once
in a row will cycle through the available window sizes. For further details,
- libwnck tries to flood the logging output with
Unhandled action type _OB_WM_ACTION_UNDECORATE\n\nmessages, which is a bug, and PyGTK doesn't expose the function needed to filter them away. As a result, the best QuickTile can do is pipe its output through grep, leaving a flood of blank lines since grep is finicky about matching them.
Thanks to Thomas Vander Stichele for some of the documentation cleanups.