Difference between revisions of "Stumpwm"

From ArchWiki
Jump to: navigation, search
(With Clisp)
(Updated much of the language, information on installing clisp; condensed/polished instructions where possible.)
Line 2: Line 2:
 
[[Category:HOWTOs (English)]]
 
[[Category:HOWTOs (English)]]
  
 +
== Introduction ==
  
==Introduction==
+
StumpWM is a tiling, full-screen window manager written entirely in
 +
Common Lisp. The successor to the cult classic [[Ratpoison]] window
 +
manager ("GNU Screen to the power of X"), StumpWM adds all the
 +
flexibility and hackability of common lisp, allowing the user to make
 +
modifications even to the source of the window manager even while it's
 +
running.
  
StumpWM is a tiling (some people say "full-screen") Windowmanager written entirely in Common Lisp.
+
From the [http://www.nongnu.org/stumpwm/ StumpWM homepage]:
The concept is based on its predecessor [[Ratpoison]] which behaves like a GNU/Screen for X.
 
As a main difference StumpWM provides a REPL (Read-Evaluate-Print-Loop) which makes it your personal hacking-playground.
 
  
From the [http://www.nongnu.org/stumpwm/ StumpWM-Homepage] :
+
If you're tired of flipping through themes like channel-surfing, and
 +
going from one perfect-except-for-just-one-thing window manager to
 +
another even-more-broken-in-some-other-way then perhaps Stumpwm can
 +
help.
  
''If you're tired of flipping through themes like channel-surfing, and going from one perfect-except-for-just-one-thing window manager to another even-more-broken-in-some-other-way then perhaps Stumpwm can help.
+
Stumpwm attempts to be customizable yet visually minimal. There are
 +
no window decorations, no icons, and no buttons. It does have various
 +
hooks to attach your personal customizations, and variables to tweak.
  
''Stumpwm attempts to be customizable yet visually minimal. There are no window decorations, no icons, and no buttons. It does have various hooks to attach your personal customizations, and variables to tweak.
+
Want to see it in action? A StumpWM user created
 +
a [http://www.archive.org/details/TheStumpWMExperience video].
  
Seeing is believing:  [http://www.archive.org/details/TheStumpWMExperience TheStumpWMExperience] (Better download the full ogg ! Flash is BAD quality !)
+
== Installation ==
  
==Installation==
+
==== With SBCL ====
  
====With SBCL====
+
# Install SBCL
'''1. install SBCL'''
+
#* <tt>pacman -S sbcl</tt>
 +
# Install [http://aur.archlinux.org/packages.php?do_Details=1&ID=12084&O=0&L=0&C=0&K=clx&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd clx] from AUR.
 +
#* If you really don't want to use a PKGBUILD here, you can also use asdf-install to install clx.
 +
# Install [http://aur.archlinux.org/packages.php?do_Details=1&ID=14549&O=0&L=0&C=0&K=cl-ppcre&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd cl-ppcre]
 +
#* Again, this can be installed with asdf-install if you really don't like PKGBUILDs.
 +
# Install git
 +
#* <tt>pacman -S git</tt>
 +
# Install stumpwm from AUR.
 +
#* Alternately, you can check it out directly from the git repo., as described on the [http://www.nongnu.org/stumpwm/ homepage]. Read the directions and check the StumpWM wiki for compilation instructions.
  
pacman -S sbcl
+
==== With Clisp ====
  
'''2. install clx 0.7.3-1 from [http://aur.archlinux.org/packages.php?do_Details=1&ID=12084&O=0&L=0&C=0&K=clx&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR]'''
+
# Use the [http://aur.archlinux.org/packages.php?do_Details=1&ID=15188 clisp-new-clx] PKGBUILD from AUR to install clisp.
 +
# Install [http://aur.archlinux.org/packages.php?ID=16205 cl-ppcre] from AUR.
 +
# Install the [http://aur.archlinux.org/packages.php?do_Details=1&ID=16206&O=&L=&C=&K=&SB=&SO=&PP=&do_Orphans=&SeB= clisp version of StumpWM] from AUR.
  
'''A better way without PKGBUILD: Fire up SBCL and type
+
As with SBCL, it's also possible to do everything the hard way. See
(require 'asdf)
+
the directions above.
(require 'asdf-install)
 
(asdf-install:install 'clx)
 
   
 
  
'''3. install cl-ppcre 1.3.2-1 from [http://aur.archlinux.org/packages.php?do_Details=1&ID=14549&O=0&L=0&C=0&K=cl-ppcre&SB=n&SO=a&PP=25&do_MyPackages=0&do_Orphans=0&SeB=nd AUR]'''
+
== Documentation and Support ==
  
'''Also better: In SBCL type
+
If you installed StumpWM by hand or still have the source lying
(require 'asdf)
+
around, there's a TeXInfo manual.
(require 'asdf-install)
 
(asdf-install:install 'cl-ppcre)
 
  
'''4. install Git'''
+
There's also a [http://stumpwm.antidesktop.net/ wiki], an IRC channel
 +
(#stumpwm) on Freenode, and a mailing list. For more information, of
 +
course, see [http://www.nongnu.org/stumpwm/ the project's website].
  
pacman -S git
+
== Tweaking ==
  
'''5. get StumpWM from its git repository'''
+
See the wiki for a variety of useful tweaks for your .stumpwmrc.
  
git clone git://git.savannah.nongnu.org/stumpwm.git
+
If you're an emacs user, you'll find an emacs major mode for editing
 +
StumpWM files (and interfacing with the program <tt>stumpish</tt>, but
 +
more on that below) in the contrib/ directory of the StumpWM source.
 +
If you're using clisp, this file can also be found in
 +
<tt>/usr/share/stumpwm/</tt>.
  
Cd to your stumpwm-dir and run
+
<tt>stumpish</tt> is the STUMP window manager Interactive SHell. It's
 +
a program that allows the user to interact with StumpWM while it's
 +
running, from the comfort of a terminal (or using the emacs mode). It
 +
can be found in the contrib/ directory of the StumpWM source. If you
 +
use clisp, this file can also be found in <tt>/usr/bin/</tt>.
  
autoconf
+
<h4>Happy hacking!</h4>
./configure && make
 
 
 
This method has two advantages over the AUR-Package:
 
 
 
1. You can edit the code and contribute to StumpWM's development.
 
 
 
2. You can simply update your StumpWM by running
 
 
 
git pull
 
 
 
in the stumpwm-dir.
 
 
 
'''6. Start Stumpwm'''
 
 
 
StumpWM now provides a much simpler startup-method:
 
Just add
 
 
 
<path/to/stumpwm>/stumpwm
 
 
 
to your .xinitrc.
 
 
 
====With Clisp====
 
 
 
Use the clisp-new-clx PKGBUILD from [http://aur.archlinux.org/packages.php?do_Details=1&ID=15188 AUR].
 
 
 
Dowload and unpack cl-ppcre from [http://weitz.de/cl-ppcre/ http://weitz.de/cl-ppcre/]. (You don't have to install anything !)
 
 
 
Configure Stumpwm with:
 
 
 
./configure --with-lisp=clisp --with-ppcre=<PATH/TO/PPCRE>
 
then
 
make
 
 
 
==Usage==
 
 
 
StumpWM comes with a very good manual
 
 
 
<path/to/stumpwm>stumpwm.texi
 
 
 
to answer most of your questions.
 
There's also a wiki at [http://stumpwm.antidesktop.net/ http://stumpwm.antidesktop.net/]
 
 
 
 
 
==Tweaking==
 
 
 
Here are just some extras for your $HOME/.stumpwmrc.
 
 
 
You can find other code snippets at the wiki or at [http://paste.lisp.org/list/stumpwm?0 http://paste.lisp.org/list/stumpwm?0].
 
 
 
====SLIME (only SBCL so far - clisp + slime = buggy)====
 
 
 
A good way to hack StumpWM is Emacs + SLIME. [http://common-lisp.net/project/slime/ SLIME] is the Superior Lisp Interaction Mode for Emacs.
 
You will get all the completion- and text-editing-power of Emacs for your StumpWM, IF....and only IF...you manage to run Slime.
 
It's easy, but of all the googled solutions, only 2-3% would work....
 
 
 
So here is a working solution:
 
*Get SLIME and extract the archive wherever you want.
 
*add the following lines to your ''.stumpwmrc
 
(load "<path/to/slime>/swank-loader.lisp")
 
(swank:create-server :dont-close t)
 
*add the following lines to your ''.emacs
 
(add-to-list 'load-path "<path/to/slime>")  ; your SLIME directory
 
(setq inferior-lisp-program "/usr/bin/sbcl") ; your Lisp system
 
(require 'slime)
 
(slime-setup)
 
 
 
Now you can connect to your StumpWM-Session from within emacs by typing: "M-x slime-connect"
 
For new SLIMErs: You have to enter (in-package stumpwm) before you can interact with the WM.
 
 
 
====Scratchpad====
 
 
 
ION3-users may miss the scratchpad-functionality. The solution is to define a new Group and access it with a key (thanks to male):
 
 
 
(defvar *scratchpad-group* '()
 
  "Group of the scratchpad.")
 
 
(define-stumpwm-command "scratchpad" ()
 
  (unless *scratchpad-group*
 
    ;; Add the (hidden) scratchpad group and give it the special number 0
 
    (setf *scratchpad-group* (add-group (current-screen) "Scratchpad")
 
          (group-number *scratchpad-group*) 0))
 
  (if (eq (current-group) *scratchpad-group*)
 
    (switch-to-group (second (screen-groups (current-screen))))
 
    (switch-to-group *scratchpad-group*))) 
 
 
(define-key *root-map* (kbd "M-SPC") "scratchpad")
 
 
 
 
 
====Window Placement Rules====
 
 
 
This is something that's not very well documented. You will find an example in the ''sample-stumpwmrc.lisp'' in your stumpwm-dir.
 
 
 
First you have to "draw" you layout. This means that you have to create all the groups you want StumpWM to put your apps into.
 
Then you have to run the command
 
 
 
dump-desktop .foo
 
 
 
in StumpWM's command prompt.
 
 
 
You can restore your layout with
 
 
 
restore .foo
 
 
 
Now add the following line to your ''.stumpwmrc
 
 
 
(run-commands "restore .foo")
 
 
 
This restores your window configuration every time you boot up StumpWM, which is necessary for the placement rules to apply.
 
 
 
Now you can add something like
 
 
 
(define-frame-preference "Scratchpad"
 
  ;; frame raise lock (lock AND raise == jumpto)
 
  (0 nil t :class "Emacs"))
 
 
 
to your ''.stumpwmrc.
 
Emacs will now be opened in your Scratchpad-Group.
 
The "nil" makes sure that this is done in the background.
 
 
 
 
 
====Stumpish====
 
 
 
Another undocumented gimmick is stumpish, the STUMPwm Interactive SHell.
 
You can find it in the contrib-directory of your stumpwm-dir.
 
 
 
This way your shell can interact with Stumpwm.
 
 
 
==Last Words==
 
Have a nice time - and share your hacks and tweaks :)
 
 
 
Talk to StumpWM-Users and -Developers on '''#stumpwm''' at '''irc.freenode.net'''.
 
If you need help or don't understand my bad English, contact me: ''Theomachos'' on '''irc.freenode.net'''.
 

Revision as of 01:55, 7 April 2008


Introduction

StumpWM is a tiling, full-screen window manager written entirely in Common Lisp. The successor to the cult classic Ratpoison window manager ("GNU Screen to the power of X"), StumpWM adds all the flexibility and hackability of common lisp, allowing the user to make modifications even to the source of the window manager even while it's running.

From the StumpWM homepage:

If you're tired of flipping through themes like channel-surfing, and
going from one perfect-except-for-just-one-thing window manager to
another even-more-broken-in-some-other-way then perhaps Stumpwm can
help.
Stumpwm attempts to be customizable yet visually minimal. There are
no window decorations, no icons, and no buttons. It does have various
hooks to attach your personal customizations, and variables to tweak.

Want to see it in action? A StumpWM user created a video.

Installation

With SBCL

  1. Install SBCL
    • pacman -S sbcl
  2. Install clx from AUR.
    • If you really don't want to use a PKGBUILD here, you can also use asdf-install to install clx.
  3. Install cl-ppcre
    • Again, this can be installed with asdf-install if you really don't like PKGBUILDs.
  4. Install git
    • pacman -S git
  5. Install stumpwm from AUR.
    • Alternately, you can check it out directly from the git repo., as described on the homepage. Read the directions and check the StumpWM wiki for compilation instructions.

With Clisp

  1. Use the clisp-new-clx PKGBUILD from AUR to install clisp.
  2. Install cl-ppcre from AUR.
  3. Install the clisp version of StumpWM from AUR.

As with SBCL, it's also possible to do everything the hard way. See the directions above.

Documentation and Support

If you installed StumpWM by hand or still have the source lying around, there's a TeXInfo manual.

There's also a wiki, an IRC channel (#stumpwm) on Freenode, and a mailing list. For more information, of course, see the project's website.

Tweaking

See the wiki for a variety of useful tweaks for your .stumpwmrc.

If you're an emacs user, you'll find an emacs major mode for editing StumpWM files (and interfacing with the program stumpish, but more on that below) in the contrib/ directory of the StumpWM source. If you're using clisp, this file can also be found in /usr/share/stumpwm/.

stumpish is the STUMP window manager Interactive SHell. It's a program that allows the user to interact with StumpWM while it's running, from the comfort of a terminal (or using the emacs mode). It can be found in the contrib/ directory of the StumpWM source. If you use clisp, this file can also be found in /usr/bin/.

Happy hacking!