I've broken out the color values, added currently playing song info to the mode-line, got rid of the trailing newline from the date, and added some keybindings to control music playback.
--- cut ----------------------------------------
----------------------------------------
-------------------------
; -*-lisp-*-
;;; .stumpwmrc 0.2
(in-package :stumpwm)
;;; Variable definitions.
(defparameter FOREGROUND-COLOR "green")
(defparameter BACKGROUND-COLOR "black")
(defparameter BORDER-COLOR FOREGROUND-COLOR)
;;; Function definitions (used internally).
;;; Taken from
http://en.wikipedia.org/wiki/User:Gwern/.stumpwmrc(defun cat (&rest strings) "A shortcut for (concatenate 'string foo bar)."
(apply 'concatenate 'string strings))
;;; Colors.
;;; Window border colors.
(set-focus-color FOREGROUND-COLOR)
(set-unfocus-color BACKGROUND-COLOR)
;;; Input box colors.
(set-bg-color BACKGROUND-COLOR)
(set-fg-color FOREGROUND-COLOR)
(set-border-color BORDER-COLOR)
;;; Modeline colors.
(setf *mode-line-background-color* BACKGROUND-COLOR)
(setf *mode-line-border-color* BORDER-COLOR)
(setf *mode-line-foreground-color* FOREGROUND-COLOR)
;;; Background.
(run-shell-command (cat "xsetroot -solid " BACKGROUND-COLOR))
;;; Init stuff.
;;; Make frames 1-indexed.
;;; See:
http://lists.gnu.org/archive/html/stumpwm-devel/2006-08/msg00002.html(setf *frame-number-map* "1234567890")
;;; Rename the first group to "Browse".
(setf (group-name (first (screen-groups (current-screen)))) "Browse")
;;; Create the other groups.
(run-commands "gnewbg Edit" "gnewbg Term" "gnewbg Chat")
;;; Change the prefix key
(set-prefix-key (kbd "C-z"))
;;; Set up X cursor and colors.
(run-shell-command (cat "xsetroot -cursor_name left_ptr -fg " BACKGROUND-COLOR " -bg " BORDER-COLOR)) ; Colors swapped here.
;;; Keep the mouse pointer out of the way.
(run-shell-command "unclutter -idle 5 -jitter 5 -root")
;;; Configure and start the modeline. Colors are handled above.
(setf *mode-line-border-width* 1)
(setf *mode-line-pad-x* 1)
(setf *mode-line-pad-y* 1)
(setf *mode-line-position* :bottom)
(setf *mode-line-timeout* 10) ; Update every 10 seconds if nothing else has triggered it already.
(setf *screen-mode-line-format* (list "[%n] [%w] [" ; Current group and frames
`(:eval (run-shell-command "mpc | head -n 1 | tr -d '\\n'" t)) ; Current playing song
"] [" ; Just a spacer
`(:eval (run-shell-command "date '+%a %b %e %H:%M' | tr -d '\\n'" t)) ; Current time
"]"))
(run-commands "mode-line")
;;; Keyboard shortcuts.
;;; Applications.
(define-key *root-map* (kbd "b") "exec firefox ")
(define-key *root-map* (kbd "e") "exec xemacs ")
(define-key *root-map* (kbd "c") (cat "exec xterm -fg " FOREGROUND-COLOR " -bg " BACKGROUND-COLOR " +cm "))
;;; MPD control.
(define-key *root-map* (kbd "Up") "exec mpc volume +10")
(define-key *root-map* (kbd "Down") "exec mpc volume -10")
(define-key *root-map* (kbd "Left") "exec mpc prev")
(define-key *root-map* (kbd "Right") "exec mpc next")
(define-key *root-map* (kbd "P") "exec mpc pause")
Tags: stumpwm
Current Mood: geeky
Current Music: Run Level Zero - My Tormentor