User Tools

Site Tools


unix:wmii

Windows Manager Improved II (wmii)

I've been experimenting with using wmii as my window manager in Ubuntu Karmic, without discarding all of the Gnome desktop features.

Creating ~/.wmii preferences

# Boiler plate for Python support
mkdir ~/.wmii
cd ~/.wmii
ln -s /etc/X11/wmii/python/pygmi pygmi
ln -s /etc/X11/wmii/python/pyxp pyxp
 
# Probably want to modify wmiirc.py (only clean way to alter the colours)
cp /etc/X11/wmii/python/wmiirc.py wmiirc.py
cp /etc/X11/wmii/python/wmiirc wmiirc

Q: Why don't new window appear in the current view?

A: Because they don't match the current tag. I wrote a script to tag all new windows with the current view.

~/.wmii/wmiirc_local.py (requires Python support libraries, see above)

#!/usr/bin/env python
import wmiirc
 
def debug(*args, **kwargs):
	print args, kwargs
 
def tag_client_with_current_view(event, client):
	wmiirc.Client(client).tags = "sel"
 
any = wmiirc.Match(wmiirc._)	# Wildcard
 
wmiirc.events.bind({
	#any: debug,
	wmiirc.Match("CreateClient"): tag_client_with_current_view,
	})

Stand-alone script, does not require any special libraries (but isn't started automatically)

#!/usr/bin/env python
 
import os
import sys
 
p = os.popen("wmiir read /event")
while True:
    event = p.readline()
    if event.startswith("CreateClient"):
        client = event.split(" ", 1)[1].strip()
        os.system("wmiir xwrite /client/%s/tags $(wmiir read /tag/sel/ctl | head -n1)" % client)
unix/wmii.txt · Last modified: 2009/12/20 20:19 by robm