spectrwm

From ConformalOpenSource
Jump to: navigation, search

If you like spectrwm, check out Cyphertite! It was conceived and coded by the same group of people who are responsible for spectrwm!


Contents

Introduction

spectrwm is a small dynamic tiling window manager for X11. It tries to stay out of the way so that valuable screen real estate can be used for much more important stuff. It has sane defaults and does not require one to learn a language to do any configuration. It was written by hackers for hackers and it strives to be small, compact and fast.

It was largely inspired by xmonad and dwm. Both are fine products but suffer from things like: crazy-unportable-language-syndrome, silly defaults, asymmetrical window layout, "how hard can it be?" and good old NIH. Nevertheless dwm was a phenomenal resource and many good ideas and code was borrowed from it. On the other hand xmonad has great defaults, key bindings and xinerama support but is crippled by not being written in C.

Spectrwm is a beautiful pearl! For it too, was created by grinding irritation. Nothing is a bigger waste of time than moving windows around until they are the right size-ish or having just about any relevant key combination being eaten for some task one never needs. The path of agony is too long to quote and in classical OpenBSD fashion (put up, or hack up) a brand new window manager was whooped up to serve no other purpose than to obey its masters. It was written by Marco Peereboom, Ryan Thomas McBride & Darrin Chandler and it is released under the ISC license. Patches can be accepted provided they are ISC licensed as well.

Following are a few screenshots of spectrwm in action.

Error creating thumbnail: File seems to be missing:
Error creating thumbnail: File seems to be missing:
Error creating thumbnail: File seems to be missing:
Error creating thumbnail: File seems to be missing:
Error creating thumbnail: File seems to be missing:

Major features

  • Dynamic xrandr & xinerama support (multi screen)
  • Navigation anywhere on all screens with either the keyboard or mouse
  • Customizable status bar
  • Human readable configuration file
  • Screenshots
  • Restartable without losing state
  • Quick launch menu
  • Many screen layouts possible with a few simple key strokes
  • Windows can be added or removed from master area
  • Windows can be moved to any workspace or within a region
  • Resizable master area
  • Move/resize floating windows
  • drag-to-float
  • User definable regions
  • User definable modkey & key bindings
  • User definable quirk bindings
  • User definable key bindings to launch applications
  • Multi OS support (*BSD, Linux, OSX, Windows/cygwin)

To-do

  • add switch between 2 windows (like alt-tab)
  • add search for window function
  • add identify window function
  • switch spectrwm from Xlib to XCB
  • make a floating stack mechanism

Please read the man pages for a more detailed explanation.

OSX

Error creating thumbnail: File seems to be missing:
OSX screenshot

A port to OSX was created to make OSX useful for UNIX people. Following are the compilation and installation steps.

Compile spectrwm from the osx directory of the snapshot:

cd osx
make

If you are using homebrew instead of macports, uncomment the lines:

INCFLAGS+= -I/opt/X11/include
LDADD+=  -lX11 -lXcursor -lXft -L/opt/X11/lib
INCFLAGS+= -I/usr/local/Cellar/freetype/2.4.10/include/freetype2

and comment out the lines:

INCFLAGS+= -I/opt/local/include/freetype2 -I/opt/local/include
LDADD+=  -L/opt/local/lib -lX11 -lXcursor -lXft

To compile spectrwm on OSX 10.5 edit the Makefile and replace:

libswmhack.so.$(LVERS): swm_hack.so
	$(CC) -shared -fpic -o libswmhack.so.$(LVERS) $(LDADD) swm_hack.so

With:

libswmhack.so.$(LVERS): swm_hack.so
	$(CC) -shared -bundle -fpic -o libswmhack.so.$(LVERS) $(LDADD) swm_hack.so

Install spectrwm:

sudo make install

Download dmenu and compile it:

make

Install dmenu:

sudo make install

Create a .xinitrc in the home dir of the user and add at least the following line:

exec spectrwm

Set the X11 preferences of OSX to the following:

Osx1.png Osx2.png Osx3.png Osx4.png Osx5.png

Windows/Cygwin

Error creating thumbnail: File seems to be missing:
Cygwin screenshot

A port to Windows/cygwin was created to make Windows useful for UNIX people. Following are the compilation and installation steps.

Compile spectrwm from the linux directory of the snapshot:

cd linux
make
Install spectrwm:
sudo make install

Download dmenu and patch config.mk with:

$ diff -uNp config.mk.old config.mk
--- config.mk.old       2010-01-11 16:23:55.503440600 -0600
+++ config.mk   2010-01-11 16:24:04.300315600 -0600
@@ -20,7 +20,7 @@ LIBS = -L/usr/lib -lc -L${X11LIB} -lX11 

# flags
CPPFLAGS = -D_BSD_SOURCE -DVERSION=\"${VERSION}\" ${XINERAMAFLAGS}
-CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
+CFLAGS = -Wall -Os ${INCS} ${CPPFLAGS}
LDFLAGS = -s ${LIBS}

# Solaris

Compile it:

make

Install dmenu:

sudo make install

To get Windows ALT key sequences (such as ALT+TAB) picked up by spectrwm, and let you use CTRL+ALT+Backspace to exit the X server, create a .xserverrc in the home dir of the user with the following line:

exec XWin :0 -nodecoration -unixkill -keyhook

Create a .xinitrc in the home dir of the user and add at least the following line:

exec /usr/local/bin/spectrwm

If the stupid menu bar in xterm angers you add the folowing line to ~/.Xdefaults

xterm.ToolBar:          false

This all results in spectrwm bliss!

spectrwm resources

License

Spectrwm is ISC licensed software; we prefer code that comes with a simple license like the OpenBSD license.template, and all the spectrwm-specific code is licensed accordingly, as follows:

/*
 * Copyright (c) 2009-2011 Marco Peereboom <marco@peereboom.us>
 * Copyright (c) 2009-2011 Ryan McBride <mcbride@countersiege.com>
 * Copyright (c) 2009 Darrin Chandler <dwchandler@stilyagin.com>
 * Copyright (c) 2009 Pierre-Yves Ritschard <pyr@spootnik.org>
 * Copyright (c) 2010 Tuukka Kataja <stuge@xor.fi>
 * Copyright (c) 2011 Jason L. Wright <jason@thought.net>
 * Copyright (c) 2011-2012 Reginald Kennedy <rk@rejii.com>
 * Copyright (c) 2012 Lawrence Teo <lteo@lteo.net>
 * Copyright (c) 2012 Tiago Cunha <tcunha@gmx.com>
 *
 * Permission to use, copy, modify, and distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

Additionally, much code in spectrwm.c comes from dwm under the following license:

/*
 * Much code and ideas taken from dwm under the following license:
 * MIT/X Consortium License
 * 
 * 2006-2008 Anselm R Garbe <garbeam at gmail dot com>
 * 2006-2007 Sander van Dijk <a dot h dot vandijk at gmail dot com>
 * 2006-2007 Jukka Salmi <jukka at salmi dot ch>
 * 2007 Premysl Hruby <dfenze at gmail dot com>
 * 2007 Szabolcs Nagy <nszabolcs at gmail dot com>
 * 2007 Christof Musik <christof at sendfax dot de>
 * 2007-2008 Enno Gottox Boland <gottox at s01 dot de>
 * 2007-2008 Peter Hartlich <sgkkr at hartlich dot com>
 * 2008 Martin Hurton <martin dot hurton at gmail dot com>
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 * DEALINGS IN THE SOFTWARE.
 */

Finally, The LD_PRELOAD hack in lib/swm_hack.c comes from e16, licensed as follows:

/*
 * Copyright (C) 2005-2007 Carsten Haitzler
 * Copyright (C) 2006-2007 Kim Woelders
 * Copyright (c) 2009-201 Ryan McBride <mcbride@countersiege.com>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies of the Software, its documentation and marketing & publicity
 * materials, and acknowledgment shall be given in the documentation, materials
 * and software packages that this Software was used.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */