auf.kante
Gunnar macht sich selbststaendig und fliegt auf
die Schnauze
wird erfolgreich. Wer mag darf zuschauen.
Gunnar is starting his business. He will certainly
fail succeed. You may watch.
auf.kante
Website sections
Home
sawfish
Last changed: 2005-07-24 [8:06]
Content:

Notes on configuring sawfish
 
Back to Personal Wiki
Table of contents
Introduction
Configuration
Radio Configuration
TODO
Links

Introduction

A 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.

Configuration

Uses 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 configuration

While sawfish is running the configuration can be reloaded using

sawfish-client -f restart

Radio Configuration

This 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.

TODO

Start one terminal running screen.

Media Stream control.

Set Background

Links

Some sawfishrc ressources:

  • sample1
  • sample2
  • sample3
  • sample4
  • sample5
  • sample6
  • sample7
Back to Personal Wiki
Creative Commons-Lizenzvertrag
The content of this site is licensed under a Creative Commons 2.5 License [attribution, share-alike]