From ArchWiki
Revision as of 15:00, 13 March 2013 by Halosghost (Talk | contribs) (Created page with "Category:Dynamic WMs {{Article summary start|Summary}} {{Article summary text|Information on installing and configuring TTWM}} {{Article summary heading|Related}} {{Articl...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Template:Article summary start Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end

TTWM is a minimal tiling window manager combining concepts or elements from tinywmAUR, dwm, and i3wm. Inspiration has also been drawn from other great tilers like monsterwm. It manages windows using tiling, horizontal or vertical stacking layouts with transient floating and fullscreen modes. The layouts all have two screen sections, the master and the stack. In most layouts, only one to two tiled windows can be visible at a time (with extra windows being tabbed in the stack area). Layouts are applied dynamically, so they can be switched on-the-fly.

TTWM is currently available in the AUR in two versions, ttwmAUR and ttwm-gitAUR. The first is the final stable build of TTWM 1.0, whereas the "-git" version is the development branch of TTWM 2.0. This page refers almost entirely to ttwm-gitAUR and TTWM 2.0. More information on TTWM 1.0 can be found upstream.


Installing TTWM, from the AUR, is as simple as fetching the PKGBUILD and running the following:

$ makepkg -si
Tip: As configuration is done at compile-time, modifications (such as customized keybindings or colorschemes) can be achieved by moving a copy of config.h (from upstream) to ~/.ttwm_conf.h and editing it to reflect any user preferences. See #Configuration

Basic usage

By Default, Template:Keypress is the "Super" or "Windows" key (the "Command" key for Apple keyboards) and Template:Keypress is the "Alt" key.

Launching Programs

Dmenu is a useful addon to TTWM. As opposed to list-style or drop-down menus, dmenu is a type-to-complete program launcher. It is the recommended launcher for TTWM, and the default configuration maps running dmenu to Template:Keypress + Template:Keypress.


To move or assign a window to a given tag, the intended window must first be focused. This can be accomplished by using Template:Keypress + Template:Keypress and/or Template:Keypress + Template:Keypress.

Action Keybind
View Tag "x" Template:Keypress + Template:Keypress
Move to Tag "x" Template:Keypress + Template:Keypress + Template:Keypress
Toggle Visibility of Tag "x" Template:Keypress + Template:Keypress + Template:Keypress
Assign to Tag "x" Template:Keypress + Template:Keypress + Template:Keypress

Controlling windows

Closing a window

Cleanly killing a window can be done by pressing Template:Keypress + Template:Keypress.

Window layouts

TTWM has five layouts. Veritcal and Horizontal Tiling, Vertical and Horizontal Stacking and "Monocle" (Full screen with statusbar tabs). By default, TTWM will run using the Vertical Tiling layout. Cycling through all five layouts can be done by pressing Template:Keypress + Template:Keypress. You can select each mode more directly with the following shortcuts:

Mode Keybind Windows visible Arrangement
V-Tile (R_ttwm) Template:Keypress + Template:Keypress + Template:Keypress 1 or 2 Master on left, stack on right
H-Tile (B_ttwm) None 1 or 2 Master on top, stack on bottom
V-Stack (rstack) Template:Keypress + Template:Keypress + Template:Keypress 1 to 3 Master on left, stack on right
H-Stack (bstack) Template:Keypress + Template:Keypress + Template:Keypress 1 to 3 Master on top, stack on bottom
Monocle Template:Keypress + Template:Keypress + Template:Keypress 1 Variable sized tabs for each window

In all layouts except Monocle, extra windows are tabbed in the stack.


To cleanly exit TTWM, press Template:Keypress + Template:Keypress + Template:Keypress.


As mentioned previously, TTWM is almost entirely configured at compile-time via the editing of its source files, primarily config.h and icons.h. The upstream configuration provides sane defaults, but configuration per user-preference is easy to achieve.

Using ~/.ttwm_conf.h

As mentioned in #Installation, ttwm-gitAUR will check for ~/.ttwm_conf.h, and, if it exists, use it to replace the default config.h before commencing the build. After using makepkg to grab the source, simply copy the config.h to ~/.ttwm_conf.h. For example, if you have the package directory in your user's home folder named ttwm-git, you would run the following command:

$ cp ~/ttwm-git/src/ttwm/config.h ~/.ttwm_conf.h

Once the desired modifications have been made, return to the package directory and compile/install:

$ makepkg -si
Tip: If you have already compiled, you may need to use the f switch to force a recompile

Assuming the configuration changes were valid, the customized TTWM will have been compiled and installed. If problems were encountered, review the output for specific information.

For any changes to take effect, it will be necessary to (re)start TTWM.

Custom Keybinds

One of the main customizations that must be made in ~/.ttwm_conf.h is the use of custom keybindings. To map a custom keybinding, add the necessary lines to the static Key keys=[] array using the following syntax:

{ MODKEY,           XK_<key>,  spawn,      CMD("program")   },


{ MODKEY,           0xHEXCODE,  spawn,      CMD("program")   },

To map a single key to a function (that is, without a modifier key), use 0 for MODKEY.

You can also define special functions for more complex commands by using #define. For example, the following MUTE function:

#define MUTE "ponymix toggle -c 0"

which could then be mapped to a keybind:

{ MODKEY,           XK_<key>,  spawn,      CMD(MUTE)   },


{ MODKEY,           0xHEXCODE,  spawn,      CMD(MUTE)   },


By passing a script or program as an argument to TTWM, it can create a minimalistic statusbar. To avoid a CPU race (See post #321), TTWM provides a default statusbar script if none is passed to it. This simple script displays only a simple clock. For a more powerful statusbar, you can either write a script (or your own small program) or use a statusbar program such as conky. If your script (or conky) takes arguments itself, remember to quote the whole statusbar argument. For example, the following commands would start TTWM with a script or conky (respectively):

$ xinit /usr/bin/ttwm "/home/username/ -args"
$ xinit /usr/bin/ttwm "conky -c /path/to/conkyrc"


TTWM supports the use of both colors and icons in the statusbar. These are painted using special codes passed in "{}". Icons are referenced using {i X} where "X" is the number of the icon. View the default icons.h to see which icons are available and what their value for X is (it is determined by the order in which each icon appears in the array at the bottom of the file). To enable TTWM to use icons, the following line must be included in ~/.ttwm_conf.h:

#include icons.h

Because these icons are sourced at compile-time, any customization of the icon-set will require the user to recompile, reinstall and restart TTWM.

Tip: By editing the PKGBUILD to use similar logic as it does with config.h and ~/.ttwm_conf.h, it is possible to create a custom icons file and allow TTWM to use these custom icon sets.

See also