IntroductionA very configurable window manager that uses lisp. Since I like to do as much as possible with the keyboard even in a windowing environment this seems to be the right choice as windowmanager at the moment. ConfigurationUses the ~/.sawfishrc file. (require 'sawfish.wm.defaults) Loads in sawfish defaults. There a number of additional lisp modules in the /usr/share/sawfish/1.3/lisp/ directory. (defun command-xterm () (interactive) (system "urxvt -bg black -fg white -sl 10000 -tr -insecure -tint grey -sh 13 -fn \"-adobe-courier-bold-r-normal-*-17-*-*-*-*-*-iso10646-*\"&") ) Executes an external program. (bind-keys global-keymap "C-T" '(command-xterm)) Binds the command to the key combination Shift-Control-t.
(setq workspace-names '("Browser" "Mail" "Terminals" "Emacs" "Projects" "Media"))
Sets the number of workspaces as well as their names. (bind-keys global-keymap "S-C-Up" 'maximize-window ) (bind-keys global-keymap "S-C-End" 'delete-window-safely) Resizing and killing windows. (bind-keys global-keymap "M-!" '(send-to-workspace 1)) Send window to alternate workspace. (bind-keys global-keymap "M-1" '(activate-workspace 1)) Switch to given workspace. Reload configurationWhile sawfish is running the configuration can be reloaded using sawfish-client -f restart Radio ConfigurationThis needed some small functions. These are the first lisp functions I ever wrote so they are certainly not elegant. The functions use the fm program as backend and you should have xosd for the on-screen-display installed. This way you will get a short on-screen message that names the current channel.
(setq radio-stations '((1 "N-JOY" "105.70") (2 "Delta Radio" "91.80")))
(setq radio-current 1)
(setq radio-max 2)
(defun radio-get-station (id)
(catch 'out
(setq stations radio-stations)
(setq station 0)
(while (= 0 station)
(if (= id (car (car stations)))
(setq station (car stations))
(setq stations (cdr stations))
)
(when (null stations)
(throw 'out nil)
)
)
station
)
)
(defun radio-get-name (id)
(car (cdr (radio-get-station id)))
)
(defun radio-get-frequency (id)
(car (cdr (cdr (radio-get-station id))))
)
(defun radio-channel-up ()
(if (= radio-current radio-max)
(setq radio-current 1)
(setq radio-current (+ radio-current 1))
)
)
(defun radio-channel-down ()
(if (= radio-current 1)
(setq radio-current radio-max)
(setq radio-current (- radio-current 1))
)
)
(defun key-radio-on ()
(interactive)
(system (concat "fm -q -d /dev/v4l/radio0 " (radio-get-frequency radio-current) "&"))
(system (concat "echo \"Radio ON - " (radio-get-name radio-current) "\" | osd_cat -c green -f -*-*-*-*-*-*-26-*-*-*-*-*-* -p middle -A center -d 1&"))
)
(defun key-radio-off ()
(interactive)
(system "fm -q -d /dev/v4l/radio0 off&")
(system "echo \"Radio OFF\" | osd_cat -c green -f -*-*-*-*-*-*-26-*-*-*-*-*-* -p middle -A center -d 1&")
)
(defun key-radio-channel-up ()
(radio-channel-up)
(key-radio-on)
)
(defun key-radio-channel-down ()
(radio-channel-down)
(key-radio-on)
)
Now you can simply bind the key functions. TODOStart one terminal running screen. Media Stream control. Set Background LinksSome sawfishrc ressources: Back to Personal Wiki |