Keyboard-driven Window Tiling for your existing X11 window manager
Important Message For Existing Users
As of QuickTile 0.3.0, the installation process has changed.
This was necessary to allow QuickTile to be split across multiple files so I could get past some mental blocks and start to clean up the code and implement new features.
- An X11-based desktop (The code expects NETWM hints and X11-style window decorations)
- Python 2.7
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 python-setuptools
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)
After you have installed the above requirements (including
via your system package manager, you can install QuickTile using either of the
- If you have
pip2installed, just run this:
sudo pip2 install https://github.com/ssokolow/quicktile/archive/master.zip
NOTE: If you attempt to use the
--upgradeoption and it fails to properly ignore system-provided dependencies, just use these commands instead:sudo pip2 uninstall quicktile sudo rm /usr/local/bin/quicktile /usr/local/bin/quicktile.py sudo pip2 install https://github.com/ssokolow/quicktile/archive/master.zip
pip2, download and unpack the zip file and run the following:
cd /path/to/local/copy ./install.sh
Technically speaking, an ordinary
sudo python2 setup.py installwill also work, but
install.shhas three advantages:
- It runs the
setup.py buildstep without root privileges to avoid leaving root-owned cruft around.
- It will attempt to remove old QuickTile files which might cause a newer install to break.
- It saves you the trouble of setting QuickTile to run on startup. (
setup.pycan't do this because it has no mechanism for adding files to
pip2, if you don't want a system-wide install:
- Download and unpack the zip file.
- Copy the
quicktilefolder and the
quicktile.shscript into a folder of your choice.
- Make sure
quicktile.shis marked executable.
NOTE: If you'd rather roll your own, the
quicktile.shshell script is just three simple lines.
quicktileonce to generate your configuration file
NOTE: If the
quicktilecommand dies with a
No module named __main__error, you probably have an old
/usr/local/binthat needs to be deleted. If that doesn't fix the problem, you should still be able to run QuickTile as
python2 -m quicktileinstead.
~/.config/quicktile.cfgto customize your keybinds
Note: Customizing the available window shapes currently requires editing the source code (though it's quite simple). This will be remedied when I have time to decide between extending the standard Python rcfile parser and replacing
Set your desktop to run
quicktile --daemonizeif you didn't use
- If you are running a desktop which uses Compiz (such as 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,
install.shmust be edited if you choose to use it.
- 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 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.
pip2 uninstalldoesn't remove the
/usr/local/bin, which can cause subsequent installs to break.
Thanks to Thomas Vander Stichele for some of the documentation cleanups.
As QuickTile does not yet have a one-command uninstall script, you will need to do the following.
- If you installed via
sudo pip2 uninstall quicktile sudo rm /usr/local/bin/quicktile
- If you installed via
install.shdoesn't yet log what it installed the way
pip2does, so this will be a bit more involved.
First, remove the system integration files:# Remove the command that can be typed at the command-line sudo rm /usr/local/bin/quicktile # Remove the autostart file sudo rm /etc/xdg/autostart/quicktile.desktop # Remove the launcher menu entry sudo rm /usr/local/share/applications/quicktile.desktop
Second, remove QuickTile itself from your Python packages folder.
As development and release installations produce different file layouts, the way I recommend doing this is to run the following command, verify that nothing looks obviously wrong about the list of files and folders it produces, and then delete them:find /usr/local/lib/python2.7 -iname 'quicktile*'