User Tools

Site Tools


unix:wmii

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
unix:wmii [2009/12/13 14:18]
robm created
unix:wmii [2009/12/20 20:19]
robm
Line 3: Line 3:
  
   * http://glyph.twistedmatrix.com/2009/01/you-got-your-windowmaker-in-my-peanut.html   * http://glyph.twistedmatrix.com/2009/01/you-got-your-windowmaker-in-my-peanut.html
 +
 +===== Creating ~/.wmii preferences =====
 +<code bash>
 +# 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
 +</code>
 +
 +===== 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)
 +<code python>
 +#!/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,
 + })
 +</code>
 +
 +Stand-alone script, does not require any special libraries (but isn't started automatically)
 +<code python>
 +#!/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)
 +
 +</code>
 +
unix/wmii.txt · Last modified: 2009/12/20 20:19 by robm