Step 1):
First off, make sure you've got the necessary prerequisites, namely sbcl, clx and autoconf. Under debian/Ubuntu just type (as root):
# apt-get install sbcl cl-clx-sbcl cl-ppcre autoconf
Package names vary from distro to distro but your distribution should come with a package manager so search through the database for the right packages. If that doesn't work, get the source and install that.
Step 2):
Get stumpwm from Git. Switch to the directory you want your stumpwm directory to be downloaded into and type:
$ git clone git://git.savannah.nongnu.org/stumpwm.git
Step 3):
Now cd to your stumpwm dir and type:
$ autoconf
If this doesn't work you need to install autoconf, (apt-get install autoconf under debian/Ubuntu)
When that's done, you'll have an executable configure script, so type:
$ ./configure && make
If this works without problem you should have an executable stumpwm file in the current directory.
If this doesn't work, make sure you read step 1 and you've got the necessary software on your system.
If you're still not having any luck there's another route, but you'll need gnupg, so download and install that (apt-get install gnupg, for example). Next type this:
$ sbcl
(require 'asdf) (require 'asdf-install) (asdf-install:install 'clx) (asdf-install:install 'cl-ppcre)
Then press Ctrl+d a couple of times to leave sbcl and try typing "make" again. Note: if you've installed the debian package for stumpwm before, apt-get remove it just to make sure, and also look in /var/cache/common-lisp-controller/1000/sbcl/local/[wherever-you-downloaded-stumpwm] and remove any .fasl files you find there.
If you've done all of the above things and tried everything again from the start then go to irc.freenode.net #stumpwm and ask sabetts for help, but you shouldn't really be having any trouble by now.
Step 4):
Now you've got a binary compiled you might want to put it in your $PATH somewhere (e.g. /usr/local/bin), so type (as root):
# install path-to-stumpwm/stumpwm /usr/local/bin/
or ln -s instead of cp to symlink it.
Step 5):
Finally you just need to tell X to launch stumpwm, so you need to add a line to your .xinitrc. If you don't already have one, you can just type:
$ echo "exec stumpwm" >> ~/.xinitrc
Note: this will only work if you copied the stumpwm binary to somewhere in your $PATH. For a local install, supply the full path, e.g. /your/home/dir/stumpwm/stumpwm
If you already have one then use your favourite text editor to add exec stumpwm to the end, or replace any existing window manager (e.g. ratpoison) you have there.
Step 6):
Restart X, any way you like (e.g. Ctrl+Alt+Backspace). If you're running a login manager like GDM then choose "Launch .xsession script" from the Sessions menu - for this reason I have a symlink for ~/.xsession to ~/.xinitrc, i.e.:
$ ln -s /your/home/dir/.xinitrc /your/home/dir/.xsession
Stumpwm should launch, with a friendly message in the top right. Press "Ctrl+t, ?" for a quick list of keys to get you started. You can add your own shortcuts in stumpwm/users.lisp . See Customize
Again, if you're still stuck, ask for help. :)
Read the README from CVS. Keep in mind, though, that in order for the SBCL script to work, you need to add the following lines to ~/.sbclrc:
;;; If the first user-processable command-line argument is a filename,
;;; disable the debugger, load the file handling shebang-line and quit.
(let ((script (and (second *posix-argv*)
(probe-file (second *posix-argv*)))))
(when script
;; Handle shebang-line
(set-dispatch-macro-character #\# #\!
(lambda (stream char arg)
(declare (ignore char arg))
(read-line stream)))
;; Disable debugger
(setf *invoke-debugger-hook*
(lambda (condition hook)
(declare (ignore hook))
;; Uncomment to get backtraces on errors
;; (sb-debug:backtrace 20)
(format *error-output* "Error: ~A~%" condition)
(quit)))
(load script)
(quit)))On some linux, SBCL has been reported to be very slow when CPU load is high, making Stumpwm almost unusable. Rebuilding SBCL from source seems to fix this issue.
#!/bin/bash -e
# We need to be bash for `type -p'.
x="$HOME/.sbcl/cores/stumpwm-$(cksum $(type -p sbcl) | cut -d ' ' -f 1).core"
if test ! -e "$x" ||
( for i in "$(dirname $(readlink ~/.sbcl/systems/stumpwm.asd))"/*.lisp
do test "$x" -ot "$i" && exit 0
done; exit 1 )
then sbcl --disable-debugger --eval "(mapc 'require '(asdf stumpwm))" --eval "(save-lisp-and-die \"$x\" :toplevel 'stumpwm:stumpwm)"
fi
exec sbcl --core "$x"The primary advantage of this method over the previous one is that it uses a core file, which boots significantly faster.
It automatically creates a new core file whenever you update the source code, and names the core files after the particular version of SBCL that you're using, so that if your $HOME is shared across multiple hosts with incompatible versions of SBCL installed, it will still work.
If you have pkgsrc-current from http://www.pkgsrc.org and pkgsrc-wip from http://pkgsrc-wip.sourceforge.net/ set up under your pkgsrc directory (and keep it updated), installing StumpWM is simply a matter of:
cd /usr/pkgsrc/lang/clisp && make PKG_OPTIONS.clisp=mit-clx && make install then cd /usr/pkgsrc/wip/stumpwm && make install
Note: You can substitute mit-clx for new-clx but one or the other is required, otherwise you may get XLIB errors when trying to compile stumpwm. The most recent patch (patch-ac) fixed a ./configure error where the --x-includes and --x-libraries weren't being passed to the configure script in the clisp work directory. See: http://pkgsrc.se/lang/clisp and the entry made on 2008-03-13 for details.