Web Analytics Made Easy -
Skip to content

Latest spectrwm - where to get it

Spectrwm seems to be the best-kept secret on the net, or at least among tiling window managers for linux. It gets less attention than others although, for me, it's the best.

In fact, it's elusive to the point that googling didn't tell me where to find the source code for the latest version. One link gave me a quite out-of-date file. For the most recent available version see here. (Of course, your distribution may provide a precompiled package too.)

Bug in spectrwm 2.0.2 affects display program

Display (part of Imagemagick) doesn't work in spectrwm 2.0.1 or 2.0.2. The program loads but doesn't produce its window. There is no problem with version 2.0.0 or earlier versions. I've reported this as a bug. Currently I'm using spectrwm 2.0.0 as my window manager.

Note added 8 October: I reported this as a bug and it is now recorded as fixed, although the new version of spectrwm doesn't seem to be available yet.

Further note added 7 November: Version 2.1.0 is now out; the bug is fixed and there are other enhancements as well. Congratulations to the developers for improving what was already my favourite tiling window manager.

Compiling spectrwm on Debian Sid

Note: this post is retained only for historical interest. The recent versions of Spectrwm compile without any problems

The current version of spectrwm in Sid (1.0.0) is old and there are many improvements in later versions. You can compile it quite easily yourself but there dependency requirements. This command will download the necessary packages.

sudo apt-get install "^libxcb*..*-dev$" libx11-xcb-dev libxrandr-dev libxft-dev libxt-dev

This comes courtesy of kbmonkey - see http://crunchbanglinux.org/forums/topic/21630/building-spectrwm-20/

So the steps are:

1, Run the above command to install all the dependencies.
2. Download the spectrwm source code and unpack it.
3. Move to the resulting directory and then to the linux subdirectory (~/spectrwm-2..x.x/linux).
4. Do "make"

If all goes well you should have a binary in that subdirectory which you can run in the usual way (e.g. from .xinitrc).

One warning: when you run the executable you may see error messages about a missing /usr/local/lib/libswmhack.so.0.0. The simplest solution is to copy this library from the linux subdirectory to /usr/local/lib and then run ldconfig.

My spectrwm configuration file (with comments)

Revised 11 October 2019

See also i3 and Spectrwm Compared

Actually, the default spectrwm.conf works pretty well, apart perhaps from changing the Mod key. It's easy to try out changes on the fly; just edit the file with the help of the man page and test it with Mod+q. If you make a mistake Spectrwm will tell you by printing an error message in the bar.

Just one caution: some mistakes may prevent spectrwm from starting, so be careful about using Mod+Shift+q. If that happens you will have to edit .spectrwm.conf without using X. This doesn't apply to Mod+q.

# PLEASE READ THE MAN PAGE BEFORE EDITING THIS FILE # http://omensource.conformal.com/cgi-bin/man-cgi?spectrwm
# NOTE: all rgb color values in this file are in hex! see XQueryColor for examples

# Mod key, (Windows key is Mod4) (Apple key on OSX is Mod2)
modkey = Mod4

workspace_limit = 5 # I don't need more than this

bind[flip_layout] = Mod+r # default binding doesn't work on my keyboard.

# The next three entries replace the default Mod+Space. Why? By default, this command cycles between the different layouts (vertical, horizontal, full screen). I seldom need to do this whereas I very frequently need to alternate the focus between main and stack. So I set Mod+Space to give focus_main and provide commands to give vertical and horizontal configurations in case these are needed. (Mod+e gives full screen.)

bind[focus_main] = Mod+space # Replace the default
bind[layout_vertical] = Mod+v # Provide vertical layout
bind[layout_horizontal] = Mod+z # Provide horizontal layout

# Window Decoration
border_width = 2
color_focus = red
# color_unfocus = rgb:88/88/88
color_unfocus = blue
tile_gap = 2

# Remove window border when bar is disabled and there is only one window in workspace
disable_border = 1

# Bar Settings
bar_enabled = 1
bar_border_width = 2
# bar_border[1] = rgb:00/80/80
# bar_border_unfocus[1] = rgb:00/40/40
bar_border[1] = yellow
bar_border_unfocus[1] = yellow
# bar_color[1] = black
# bar_font_color[1] = rgb:a0/a0/a0
bar_font_color[1] = white
# bar_font = -*-terminus-medium-*--*--*--*--*--
bar_font = -*-courier-*-r-*--*-120-*--*--*-
# bar_action = conky
bar_justify = left
bar_format = %a %b %d %R +S +F +L +V
#bar_format = +N +I +S <+D>+4<%a %b %d %R %Z %Y+8<+A+4<+V
bar_at_bottom = 1
# stack_enabled = 1
#clock_enabled = 1
# clock_format = %a %b %c %d %R %Z %Y
# region_padding = 0
window_name_enabled = 1
# verbose_layout = 1
# urgent_enabled = 1

# Split a non-RandR dual head setup into one region per monitor
# (non-standard driver-based multihead is not seen by spectrwm)
# region = screen[1]:1280x1024+0+0
# region = screen[1]:1280x1024+1280+0

# Launch applications in a workspace of choice
# Not needed because my desktop is normally running non-stop

# Customize workspace layout at start (not needed - see above)
# layout = ws[2]:0:0:1:0:fullscreen
# layout = ws[3]:0:0:0:0:vertical
# layout = ws[4]:0:0:1:0:fullscreen

iconic_enabled = 1

# This restricts toggling bar to one workspace
bind[bar_toggle_ws] = Mod+b

# The default key bindings for screenshots are easy to hit accidentally so replace these with Mod+F12 etc.
bind[] = Mod+s
bind[] = Mod+Shift+s
bind[screenshot_all] = Mod+F12
bind[screenshot_wind] = Mod+Shift+F12

# Swap between workspaces back and forth (very useful)
# Can use alternatives
bind[ws_prior] = Mod+Shift+Up
bind[ws_prior] = Mod+Shift+Down
bind[ws_prior] = Mod+Shift+Left
bind[ws_prior] = Mod+Shift+Right

# This allows you to include pre-defined key bindings for your keyboard layout.
# keyboard_mapping = ~/.spectrwm_us.conf

# Validated default programs:
program[lock] = xterm # I don't need to lock screen so avoid doing it accidentally
program[term] = xterm

# Default quirks, remove with: quirk[class:name] = NONE
# quirk[MPlayer:xv] = FLOAT + FULLSCREEN + FOCUSPREV
# quirk[OpenOffice.org 2.4:VCLSalFrame] = FLOAT
# quirk[OpenOffice.org 3.0:VCLSalFrame] = FLOAT
# quirk[OpenOffice.org 3.1:VCLSalFrame] = FLOAT
# quirk[xine:Xine Window] = FLOAT + ANYWHERE
# quirk[Xitk:Xitk Combo] = FLOAT + ANYWHERE
# quirk[xine:xine Panel] = FLOAT + ANYWHERE
# quirk[Xitk:Xine Window] = FLOAT + ANYWHERE
# quirk[xine:xine Video Fullscreen Window] = FULLSCREEN + FLOAT
# quirk[pcb:pcb] = FLOAT
quirk[Xsane:xsane] = FLOAT + ANYWHERE
# quirk[XaoS:xaos] = FLOAT + ANYWHERE
# quirk[Firefox:firefox] = TRANSSZ
# quirk[Firefox:Dialog] = FLOAT
quirk[Gimp:gimp] = FLOAT + ANYWHERE
# quirk[XTerm:xterm] = XTERM_FONTADJ

Four tiling window managers: spectrwm, i3, dwm, xmonad

Revised 22 August 2017

For several months last year I was trying out various tiling window managers and here I offer my assessment of the ones I've used most. There's more about many of them, including configuration files, elsewhere in this blog (see the tags list).

See also i3 and Spectrwm compared.

My outright favourite is Spectrwm because I find that it offers all the features I want without making things over-complicated. Configuration via the text file is easy and the commands quickly become intuitive and automatic. Dwm is almost as good as spectrwm but lacks some features that I want. i3 seems to be a popular WM and is better known than Spectrwm, I like it quite a lot but I find Spectrwm more intuitive to use. Xmonad is an attractive WM but is irretrievably let down by requiring Haskell to configure it.


1. Spectrwm
This is currently my favourite. It used to be called scrotwm and this rather unfortunate and juvenile-sounding name put some people off. When I tried it some time ago it seemed a little buggy but that is much better now. Configuration by a plain text file is simple. I prefer the lack of window titles at the top and I find spectrwm more intuitive to use than i3. The default window layout is similar to those of dwm and xmonad; it is easy to change the arrangement. It is also easy to switch to a different workspace (desktop) with Mod+Arrow, which I particularly like. The bar at the bottom of the screen is toggled on and off with Mod+B, another good feature. I should say that spectrwm is the most flexible and intuitive WM that I've tried. Currently I'm using it as my default window manager. Download Spectrwm here (updated link).

Here are some screenshots. (Actually, I work fullscreen much of the time, with a browser on one workspace, mutt on another, and so on.)

A screen with three windows (left = master)—vertical split
Screenshot 1

Change master window (Mod + Return)

Screenshot 2

Enlarge master window (Mod + L)
Screenshot 3

Change to horizontal split (Mod + Space)

Screenshot 4

Make a window fullscreen.(Mod + E)

Screenshot 5

Switch to Workspace 2 from Workspace 1 (Mod +2 or Mod + R. arrow)
Screenshot 6

Note: the xsane windows are floating (set via Quirk in ~/.spectrwm.conf).

2. Dwm
Dwm is the forerunner from which many other tiling WMs forked. There is still a lot going for it: it's simple and functional and easy to learn. Configuration is via C, but don't be put off; it's easier than it looks even if you don't know C (I don't). If you are not willing to embark on learning Haskell, dwm would be an attractive alternative.

3. I3
I liked i3 quite a lot and used it for a time. Configuration is simple since it is done in plain text. The default tiled layout has the windows arranged in columns across the screen which I don't much care for. But I mostly work in stacked mode, and i3 does well like this. The only problem is that if you have a number of windows open their titles list takes up a lot of space at the top of the screen in stacked mode. Admittedly you can fix this by going into full-screen mode, although you must exit that to switch to a different window. But while I liked i3, I found that everything I wanted to do with it could also be done in spectrwm and usually more easily and intuitively.

4. Xmonad
his has a large user base and a helpful mailing list. It has many of the features I want but is let down by its being written in Haskell, which makes any configuration beyond the most basic a major undertaking requiring hours of research on the internet. There is also a large overhead in terms of disk space required to house the libraries needed for said configuration. For these reasons Xmonad loses out to its competitors, at least for me.

Tiling window managers for X - Icewm and Ratpoison

Update: This discussion is out of date. I now use tiling WMs exclusively and my favourite is Spectrwm. Please see the tags for more details.

I'm a committed Linux user. I don't like desktop managers such as KDE, Gnome, or XFCE. I've no use for eye candy, background images, icons, and the rest, so I use the plainest window manager (WM) I can find that does the job, I've tried a lot of different ones in the past but have always come back to Icewm in the end. But lately I'm using it in a different way, to make it more similar tol Ratpoison.

Why Ratpoison? Most of the WMs I tried merely added stuff I didn't want. The one exception to this was the tiling WM family, like Ratpoison, dwm. or Lunchbox - there are quite a few. I like the idea of their simplicity and functionality. I did try some of them but most, apart from Ratpoison, were difficult to configure, and anyway, I decided that the tiling business wasn't much of an improvement on the stacking offered by Icewm.

Recently, while googling, I noticed that quite a lot of Ratpoison enthusiasts didn't tile at all but always worked fullscreen. That, I thought, would suit my style of working well, since I seldom need to see more than one application at a time. I do have Mutt and Iceweasel running but they were parked in workspaces of their own. Anyway, I installed Ratpoison again and ran it fullscreen, without tiling. I quickly realised that this was exactly what I wanted.

But things weren't perfect. Graphical programs such as the Gimp were said not to work very well in Ratpoison because of their floating windows. The solution suggested for this was to replace Ratpoison temporarily with another WM - Ratpoison has a command for this. That worked; I could swap back to Icewm for the moment. But then it occurred to me that if I ran my favourite Icewm fullscreen I would get almost the same effect as Ratpoison while preserving all the things I like about Icewm. So that's what I'm doing now.

Ratpoison, as the name implies, doesn't use the mouse at all. Icewm does allow the mouse but it is entirely usable without it; there are keyboard commands for everything. This suits me perfectly; I prefer to avoid the mouse whenever possible but there are times when it is useful to have it. So now I see only one application at a time, filling the whole screen; I can swap back and forth to any others that are open, mostly just using Alt-Tab. I hardly ever need to have more than one application visible, but occasionally it is useful to do so, for example when looking at a cheat sheet to remember keys or for copying stuff from one application to another (mouse needed here). For that purpose I have a second workspace available.

Previously I used to have seven workspaces, which was sometimes annoying if I couldn't remember where I'd opened something. Now I work in the same work space all the time but if, rarely, I want a second application to be visible, I swap across briefly to the other workspace (I've named them Main and Temp )

I realise that this setup wouldn't suit everyone but so far it does suit me, so I thought I'd share it.