Web Analytics Made Easy -
Skip to content

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


No Trackbacks


Display comments as Linear | Threaded

Mike on :

Thank you for sharing this! I've begun reading "Totality Beliefs and the Religious Imagination" which naturally led me to your web site. Happy to see you're a fan of Unix/Linux as well! I've dabbled with some tiling window managers but this is the the first time I've tried Spectrwm. So far so good! I do appreciate the simple configuration file and sane defaults. Here's what I have so far: https://scrot.moe/image/6GQPW. I'll continue to tweak it over time but I'm quite pleased already.

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.
How many legs do snakes have?
Form options