Alopex
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.
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.
Contents
Installation
Installing TTWM, from the AUR, is as simple as fetching the PKGBUILD and running the following:
$ makepkg -si
config.h
(from upstream) to ~/.ttwm_conf.h
and editing it to reflect any user preferences. See #ConfigurationBasic usage
By Default, TTWM tracks the following four modifier masks:
Reference | Key |
---|---|
Template:Keypress | "Super" |
Template:Keypress | "Alternate" |
Template:Keypress | "Control" |
Template:Keypress | "Shift" |
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.
Using tags
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 |
Assign to Tag "x" | Template:Keypress + Template:Keypress + Template:Keypress |
Toggle Visibility of Tag "x" | Template:Keypress + Template:Keypress + Template:Keypress |
Window layouts
TTWM has three rule-based layouts complimented by transient fullscreen and floating modes: Vertical and Horizontal Stacking and "Monocle" (Full screen with statusbar tabs). By default, TTWM will run using the Vertical Stacking layout. Cycling through all three 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-Stack (rstack) | Template:Keypress + Template:Keypress + Template:Keypress | 3 | Master on left, stack on right |
H-Stack (bstack) | Template:Keypress + Template:Keypress + Template:Keypress | 3 | Master on top, stack on bottom |
Monocle | Template:Keypress + Template:Keypress + Template:Keypress | 1 | Variable sized tabs for each window |
Using the stackcount
option in ~/.ttwm_conf.h
, you can specify how many windows you would like to be visible in the stack. You can also use Template:Keypress + Template:Keypress and Template:Keypress + Template:Keypress to dynamically increment and decrement the number of visible windows in the stack (respectively). Furthermore, using Template:Keypress + Template:Keypress will keep all open windows visible.
Exiting
Cleanly killing a window can be done by pressing Template:Keypress + Template:Keypress. Cleanly exiting TTWM can be done by pressing Template:Keypress + Template:Keypress + Template:Keypress.
Extended Usage
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
f
switch to force a recompileAssuming 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 Keybindings
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, <key>, spawn, CMD("program") },
0
for MODKEY
.<key> can either be a hex keycode (e.g., 0x68
) or an X keysym (e.g., XK_h
). You can check for keycodes and keysyms by using xorg-xev.
You can also define special functions for more complex commands by using #define
:
#define FUNCTION "program -switches --options arguments"
which could then be mapped to a keybind using CMD(FUNCTION)
in the above syntax.
#define FUNCTION
, you do not quote FUNCTION
in the keybinding declaration.Configuration Options
Aside from custom keybinds, TTWM offers various configuration options which can be modified in ~/.ttwm_conf.h
to help you fine-tune your TTWM setup. Below is an abridged list of available configuration options and explanations of their settings:
Option | Possible Values | Function |
---|---|---|
borderwidth | 0, 1, 2, etc. | Sets the size of a border to be drawn around the focused window |
tilegap | 0, 1, 2, etc. | Sets the size of a gap to be left between windows |
win_min | 0, 1, 2, etc. | Sets the smallest allowed width and height of a window |
focusfollowmouse | True or False | If "True," hovering the mouse over a window will shift focus to that window |
showbar | True or False | Enables or disables the statusbar |
topbar | True or False | If "True," the statusbar is displayed on the top of the screen. If "False," on bottom |
tilebias | 0, 1, 2, etc. | Determine how much larger (in pixels) the master section is than the stack (0 divides them equally) |
attachmode | 0, 1 or 2 | Determines where to place new windows (0 == master section, 1 == top of the stack, 2 == bottom of the stack) |
Statusbar
By passing a script or program as an argument to TTWM, it can create a minimalistic statusbar. To avoid a CPU race, TTWM provides a default statusbar script if none is passed to it. This default 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 the script (or program) you use 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/script.sh -args"
$ xinit /usr/bin/ttwm "conky -c /path/to/conkyrc"
To colorize parts (or all) of the output of the script, you can use {#RRGGBB}. "#RRGGBB" is a standard hex color code and using these in brackets will colorize everything on the statusbar following it until another color code is passed.
Using ~/.ttwm_icons.h
As with config.h
, TTWM supports custom iconsets using a customized icons.h
which should be placed at ~/.ttwm_icons.h
.
Icons, similar to the bracketed color codes, are referenced in the statusbar script or program 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.
Multi-Monitor Support
TTWM has experimental support for up to 16 external monitors using xrandr. Though auto-detection of external montiors is not yet supported, it is planned for version 2.1. Unlike with the internal monitor, TTWM handles windows with slightly different rulesets on external monitors. Each window is assigned a monitor number (in addition to tags/flags and other info). If the monitor number is higher than the number of available monitors, the window is placed on the highest numbered monitor, otherwise it is placed on the monitor matching its number. See the documentation on the BBS, and in config.h
for more details.
See also
- TTWM's official website (Refers to 1.0)
- TTWM's Sourcecode on GitHub
- dmenu - Simple application launcher from the developers of dwm
- The TTWM thread on the forums