#!/bin/sh # configure wmii pidfile=/tmp/ns.$USER.$DISPLAY/wmiircpid xwrite() { file="$1"; shift echo -n "$@" | wmiir write "$file" } proglist() { for dir in `echo $@ | sed 's/^:/.:/; s/::/:.:/; s/:$/:./' | tr : ' '` do for i in $dir/* do test -x "$i" && test ! -d "$i" && echo `basename "$i"` done done | sort | uniq } test -f $pidfile && kill `cat $pidfile` 2>/dev/null echo $$ >$pidfile MODKEY=Alt WMII_FONT='fixed' export WMII_FONT WMII_NORMCOLORS='#222222 #eeeeee #666666' export WMII_NORMCOLORS WMII_SELCOLORS='#ffffff #285577 #4c7899' export WMII_SELCOLORS # WM CONFIGURATION xwrite /def/border 3 xwrite /def/snap 20 xwrite /def/font $WMII_FONT xwrite /def/selcolors $WMII_SELCOLORS xwrite /def/normcolors $WMII_NORMCOLORS # BAR CONFIGURATION wmiir create /bar/foo xwrite /bar/foo/colors $WMII_SELCOLORS xwrite /bar/expand foo # MISC xsetroot -solid '#0b1014' status & proglist $OLD_PATH >/tmp/ns.$USER.$DISPLAY/progs & # SHORTCUTS while read key do wmiir create /keys/$key done </dev/null | while read event do set -- $event type="$1"; shift case "$type" in NT) wmiir create /bar/$1 if test $1 = "$oldtag" then xwrite /bar/$1/colors $WMII_NORMCOLORS else xwrite /bar/$1/colors $WMII_SELCOLORS fi xwrite /bar/$1/data $1;; RT) wmiir remove /bar/$1;; TF) if test -n "$oldtag" then xwrite /bar/$oldtag/colors $WMII_SELCOLORS fi xwrite /bar/$1/data $1 xwrite /bar/$1/colors $WMII_NORMCOLORS oldtag=$1;; LB) if wmiir read /tags | awk "\$NF == $1 {exit 1}" then : # no tag label else xwrite /ctl select $1 fi;; K) case "$1" in $MODKEY-Control-c) xwrite /ws/sel/sel/ctl kill;; $MODKEY-Control-w,y) wmiirc &;; $MODKEY-Control-q,y) xwrite /ctl quit;; $MODKEY-Control-p) extern `wmiimenu $pidfile