Wmii setup

Yep, i started using wmii, insane me. I usually have 6 workspaces, and I'm still using "alt" as my default modifier, which is a real PITA.

Workspaces

Here are my 6 workspaces:

/XMMS.*/ -> ~
/Gimp.*/ -> ~
/MPlayer.*/ -> ~
/Thunder.*/ -> 1
/Firefox.*/ -> 2
/XChat.*/ -> 3
/irssi/ -> 3
/.*[Tt]erm.*/ -> 4
/Quodlibet.*/ -> 5
/Workrave.*/ -> 6
/.*/ -> 1

Yes, only a wmii geek can understand that.

Favorite applications

I am still using thunderbird for my mail, firefox for the web, but I have started using irssi instead of xchat, i don't remember why… Since I'm using more terminals than before, i have also /blog/2007-05-30-la-resolution-et-les-laptops.

I have therefore set cool symlinks to have all those lovely things in my menu:

$ ls -l .wmii-3
lrwxrwxrwx  1 anarcat anarcat   16 2006-07-21 06:09 firefox -> /usr/bin/firefox
-rwxr-xr-x  1 anarcat anarcat   64 2006-07-21 06:12 irssi
lrwxrwxrwx  1 anarcat anarcat   18 2006-07-21 06:27 quodlibet -> /usr/bin/quodlibet
lrwxrwxrwx  1 anarcat anarcat   20 2006-07-21 06:09 thunderbird -> /usr/bin/thunderbird
-rwxr-xr-x  1 anarcat anarcat 4366 2006-07-21 13:33 wmiirc

Note how irssi is actually not a symlink but a simple shell script:

exec x-terminal-emulator -T irssi -e /usr/bin/irssi

Parenthesis: rxvt setup

This mostly sets up transparency and reverse video.

Rxvt.reverseVideo: true
URxvt.inheritPixmap: true
URxvt.tint: true
URxvt.shading: 90
URxvt.tintColor: grey
URxvt*reverseVideo: true
URxvt*saveLines: 10000
URxvt*externalBorder: 0
URxvt*internalBorder: 0
URxvt*scrollBar: False
URxvt*termName: rxvt

Startup programs

# MISC
#xsetroot -solid '#333333'
killall chbg;      chbg -R -randomize $HOME/Photos &
killall xautolock; xautolock &
killall conky;     conky &
workrave &
status &

So that's http://chbg.sourceforge.net/, http://freshmeat.net/projects/xautolock/, http://conky.sourceforge.net/ and http://workrave.org/.

Keybindings

		$MODKEY-F2)
			PATH="$OLD_PATH" x-terminal-emulator -e '/home/anarcat/bin/ssh-stub' &;;
		$MODKEY-F3)
			PATH="$OLD_PATH" x-terminal-emulator &;;
		$MODKEY-F4)
			PATH="$OLD_PATH" x-terminal-emulator -e su &;;

I use the same keybindings as in my sawfish setup, in general…

Complete configuration file

#!/bin/sh
# configure wmii

xwrite() {
	file="$1"; shift
	echo -n "$@" | wmiir write "$file"
}

proglist() {
	ls -lL "$@" 2>/dev/null | awk 'NF>2 && $1 ~ /^[^d].*x/ {print $NF}' | sort -u
}

setxkbmap -layout ca,us -option -option 'grp:sclk_toggle'

MODKEY=Mod1
UP=j
DOWN=k
LEFT=h
RIGHT=l

WMII_FONT='fixed'
#WMII_FONT='-*-courier-*-r-*-*-12-*-*-*-*-*-iso10646-*'
WMII_SELCOLORS='#ffffff #285577 #4c7899'
WMII_NORMCOLORS='#222222 #eeeeee #666666'
# dark background
#WMII_NORMCOLORS='#e0e0e0 #0a0a0a #202020'

export WMII_FONT WMII_NORMCOLORS WMII_SELCOLORS

# give wmiiwm a chance to start
while :
do
	echo Start wmiirc | wmiir write /event >/dev/null 2>&1 && break
	sleep 1
done

# WM CONFIGURATION
xwrite /def/border 1
xwrite /def/font $WMII_FONT
xwrite /def/selcolors $WMII_SELCOLORS
xwrite /def/normcolors $WMII_NORMCOLORS
xwrite /def/colmode default
xwrite /def/colwidth 0

# TAGGING RULES
wmiir write /def/rules <<EOF
/XMMS.*/ -> ~
/Gimp.*/ -> ~
/MPlayer.*/ -> ~
/Thunder.*/ -> 1
/Firefox.*/ -> 2
/XChat.*/ -> 3
/irssi/ -> 3
/.*[Tt]erm.*/ -> 4
/Quodlibet.*/ -> 5
/Workrave.*/ -> 6
/.*/ -> 1
EOF

# MISC
#xsetroot -solid '#333333'
killall chbg;      chbg -R -randomize $HOME/Photos &
killall xautolock; xautolock &
killall conky;     conky &
workrave &
status &
PROGS_FILE=`mktemp /tmp/.wmiimenu.proglist.XXXXXX` || exit 2
proglist `echo "$OLD_PATH" | tr : ' '` >$PROGS_FILE &

# SHORTCUTS
#xwrite /def/grabmod $MODKEY
wmiir write /def/keys <<EOF
$MODKEY-$LEFT
$MODKEY-$RIGHT
$MODKEY-$DOWN
$MODKEY-$UP
$MODKEY-space
$MODKEY-d
$MODKEY-f
$MODKEY-s
$MODKEY-m
$MODKEY-a
$MODKEY-p
$MODKEY-t
$MODKEY-0
$MODKEY-1
$MODKEY-2
$MODKEY-3
$MODKEY-4
$MODKEY-5
$MODKEY-6
$MODKEY-7
$MODKEY-8
$MODKEY-9
$MODKEY-F1
$MODKEY-F2
$MODKEY-F3
$MODKEY-F4
$MODKEY-F5
$MODKEY-F6
$MODKEY-F7
$MODKEY-F8
$MODKEY-Return
$MODKEY-Shift-$LEFT
$MODKEY-Shift-$RIGHT
$MODKEY-Shift-$UP
$MODKEY-Shift-$DOWN
$MODKEY-Tab
$MODKEY-Shift-Tab
$MODKEY-Shift-space
$MODKEY-Shift-c
$MODKEY-Shift-t
$MODKEY-Shift-0
$MODKEY-Shift-1
$MODKEY-Shift-2
$MODKEY-Shift-3
$MODKEY-Shift-4
$MODKEY-Shift-5
$MODKEY-Shift-6
$MODKEY-Shift-7
$MODKEY-Shift-8
$MODKEY-Shift-9
$MODKEY-Control-$LEFT
$MODKEY-Control-$RIGHT
$MODKEY-Control-$DOWN
$MODKEY-Control-$UP
EOF

# EVENT LOOP
wmiir read /event 2>/dev/null |
while read event
do
	set -f
	set -- $event
	set +f
	type="$1"; shift
	case "$type" in
	Start)
		if test wmiirc = "$1"
		then
			rm -f $PROGS_FILE
			exit
		fi;;
	BarClick)
		xwrite /ctl view "$1";;
	Key)
		case "$1" in
		$MODKEY-$LEFT)
			xwrite /view/ctl select prev;;
		$MODKEY-$RIGHT)
			xwrite /view/ctl select next;;
		$MODKEY-Tab)
			xwrite /view/sel/ctl select next;;
		$MODKEY-Shift-Tab)
			xwrite /view/sel/ctl select prev;;
		$MODKEY-space)
			xwrite /view/ctl select toggle;;
		$MODKEY-d)
			xwrite /view/sel/mode default;;
		$MODKEY-s)
			xwrite /view/sel/mode stack;;
		$MODKEY-m)
			xwrite /view/sel/mode max;;
		$MODKEY-f)
			xwrite /view/0/sel/geom 0 0 east south;;
		$MODKEY-a)
			`proglist $HOME/.wmii-3 /etc/X11/wmii-3 | wmiimenu` &;;
		$MODKEY-p)
			PATH="$OLD_PATH" wmiisetsid `wmiimenu <$PROGS_FILE` &;;
		$MODKEY-t)
			xwrite /ctl view "`wmiir read /tags | wmiimenu`" &;;
		$MODKEY-F2)
			PATH="$OLD_PATH" x-terminal-emulator -e '/home/anarcat/bin/ssh-stub' &;;
		$MODKEY-F3)
			PATH="$OLD_PATH" x-terminal-emulator &;;
		$MODKEY-F4)
			PATH="$OLD_PATH" x-terminal-emulator -e su &;;
		$MODKEY-F5)
			xmms --rew &;;
		$MODKEY-F6)
			xmms --stop &;;
		$MODKEY-F7)
			xmms --play-pause &;;
		$MODKEY-F8)
			xmms --fwd &;;
		$MODKEY-[0-9])
			xwrite /ctl view `echo $1 | sed 's/.*-//'`;;
		$MODKEY-Shift-$LEFT)
			xwrite /view/sel/sel/ctl sendto prev;;
		$MODKEY-Shift-$RIGHT)
			xwrite /view/sel/sel/ctl sendto next;;
		$MODKEY-Shift-$DOWN)
			xwrite /view/sel/sel/ctl swap down;;
		$MODKEY-Shift-$UP)
			xwrite /view/sel/sel/ctl swap up;;
		$MODKEY-Shift-space)
			xwrite /view/sel/sel/ctl sendto toggle;;
		$MODKEY-Shift-c)
			xwrite /view/sel/sel/ctl kill;;
		$MODKEY-Shift-t)
			xwrite /view/sel/sel/tags "`wmiir read /tags | wmiimenu`" &;;
		$MODKEY-Shift-[0-9])
			xwrite /view/sel/sel/tags `echo $1 | sed 's/.*-//'`;;
		$MODKEY-Control-$LEFT)
			xwrite /view/sel/sel/ctl swap prev;;
		$MODKEY-Control-$RIGHT)
			xwrite /view/sel/sel/ctl swap next;;
		$MODKEY-Control-$DOWN)
			xwrite /view/sel/sel/ctl swap down;;
		$MODKEY-Control-$UP)
			xwrite /view/sel/sel/ctl swap up;;
		esac;;
	esac
done &
Created . Edited .