SmallWM is an extended version of TinyWM, made for actual desktop use.
This is the newest version, rewritten in C++ - you can checkout the
branch if you want to use the old C version.
- Window Iconification
- Window Layering
- Click-To-Focus (Focus Is Indicated By Colored Borders)
- Moving/Resizing Placeholders
- Multiple Virtual Desktops (With Window Sticking)
- Window Snapping
- Class Actions
Note that these are the default controls - one of the improvements of the C++
port is that it SmallWM now supports configurable keybindings. See the Configuration
for details on how to setup keybindings. The only non-configurable key bindings are the
ones that involve clicking the mouse, and the
Super+[: Move a client to the previous desktop (
Super+]: Move a client to the next desktop (
Super+,: Swicth to the previous desktop (
Super+.: Switch to the next desktop (
Super+\: Sticks/unsticks a window; a stuck window is shown on all desktops (
Super+h: Iconifies the current client (
Super+m: Maximizes the current client (
Super+c, Requests the current client to close (
Super+x: Force-closes the current client (
Super+Right: Snaps a window to either the top-half, bottom-half, left-half or right-half of the screen.
Super+PageDown: Increments or decrements the layer of this client.
Super+End: Puts a client on the topmost or bottommost layer.
Super+LClick: Dragging the left mouse button starts moving a window - to place it, let go.
Super+RClick: Dragging the right mouse button starts resizing a window - to scale it, let go.
Super+9: These change the layer to the specified value (1, 5, or 9 respectively, in this example)
Super+LClick: Left-clicking the root window launches a new terminal.
Super+Escape: Quits SmallWM.
As a dependency, you'll need to have acxess to the headers for Xlib and XRandR. You should be able to easily obtain these via your package manager. You'll also need a C++ compiler - GNU G++ and clang++ work well.
Other than the dependencies, the Makefile contains everything you need to build and test SmallWM.
makecompiles a version with symbols useful for debugging. Note that there is no optimized build - if you want an optimized version, open the Makefile and change
For modifying SmallWM, the other target that you should be aware of is
which compiles everything but does no linking. This is useful for incremental building
to track compiler errors in source files.
The C++ version follows a similar configuration file format to the original C version, but with some extended options. For example:
[smallwm] shell=your-preferred-terminal desktops=42 icon-width=75 icon-height=20 border-width=4 icon-icons=0 [actions] stalonetray=stick,layer:99 [keyboard] toggle-stick=asciitilde snap-top=w snap-bottom=s snap-left=a snap-right=d
The options in the
[smallwm] section are (in order):
- The shell launched by
Super+LClick(default: xterm). This can be any syntax supported by /bin/sh.
- The number of desktops (default: 5)
- The width in pixels of icons (default: 75)
- The height in pixels of icons (default: 20)
- The width of the border of windows (default: 4)
- Whether to (1) or not to (0) show application icons inside icon windows. (default: 1)
The options in the
[actions] section are covered next, and then the
[keyboard] section after that.
X has the notion of an application "class" which is supposed to be a unique
identifier for a window which belongs to a particular application. For example,
there is a popular system tray called
stalonetray which I use personally to
manage status notifiers (like for NetworkManager, Dropbox, and the like). A
xprop of the window shows that its class name is
The example given in the Configuration section shows how to stick any window belonging to stalonetray and layer it on top of all other applictation windows. Generally speaking, any number of these class actions can be chained together by separating them with commas.
The possibilities for a class action are:
stickmakes a particular window stick to all the desktops
maximizemaximizes that window
layer:xsets the layer of the window to
xis a number in the range 10 to 99 (the default layer is 50).
snap:bottomsnap the window to the relevant side of the screen
Starting with the C++ rewrite, keyboard bindings in SmallWM are almost entirely
Super+9) configurable. The mechanism isn't that
sophisticated, however, so make sure that you have a copy of
or an equivalent file open.
In order to bind a key, you first have to know the name of the "keysym" that the
key uses. To do this, search
keysymdef.h for your key - the keysym name is the first
word after the
#define. The text that you put in the configuration file is the
keysym name but with the leading
XK_ removed. For example, take
toggle-stick=asciitilde in the example configuration file. This binds the
action to the
The following options can be set under the
[keyboard] section to configure SmallWM's
keyboard bindings. Their meanings should be fairly obvious - if not, go to the
list of default bindings and see what each of these bindings mean.
- Support for the EWMH and the
- Nick Welch email@example.com, the original TinyWM author.
- Myself (Adam Marchetti firstname.lastname@example.org).
- The author(s) of the inih library.
- Possibly, you - assuming you make any useful changes and I accept your pull request. Refactorings are welcome, as are those who are actually knowledgeable about Xorg and could spot any obvious mistakes.
SmallWM was migrated to the 2-Clause BSD License on 2013-11-18. See LICENSE.txt for details.
The inih code, included as a part of SmallWM, is available under the New BSD License. See
inih/LICENSE.txt for details.