#!/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 xwrite /1/1/capacity 1 # BAR CONFIGURATION while wmiir remove /bar/0 2>/dev/null do : done xwrite /bar/new/colors $WMII_NORMCOLORS xwrite /bar/new/colors $WMII_SELCOLORS xwrite /bar/0/data 1 xwrite /bar/expand 1 # MISC xsetroot -solid '#0b1014' status & proglist $OLD_PATH >/tmp/ns.$USER.$DISPLAY/progs & # SHORTCUTS while read key do echo -n | wmiir create /keys/$key done </dev/null | while read event do set -- $event type="$1"; shift case "$type" in PN) xwrite /bar/0/data "$@";; LB) case "$2" in 1) xwrite /ctl select prev;; 3|4) xwrite /ctl select next;; 5) xwrite /ctl select prev;; esac;; K) case "$1" in $MODKEY-Control-c) xwrite /sel/sel/sel/ctl kill;; $MODKEY-Control-w,y) wmiirc &;; $MODKEY-Control-q,y) xwrite /ctl quit;; $MODKEY-Control-r) wmiir remove /sel;; $MODKEY-Control-p) extern `wmiimenu /dev/null;; $MODKEY-Shift-m) xwrite /sel/sel/mode max;; $MODKEY-Shift-s) xwrite /sel/sel/mode stack;; $MODKEY-Shift-equal) xwrite /sel/sel/mode equal;; $MODKEY-Return) xwrite /sel/sel/sel/ctl sendtoarea prev;; $MODKEY-Shift-Return) xwrite /sel/sel/sel/ctl sendtoarea next;; $MODKEY-Control-y) xwrite /new/1/capacity 1;; $MODKEY-h) xwrite /sel/ctl select prev;; $MODKEY-l) xwrite /sel/ctl select next;; $MODKEY-Tab) xwrite /sel/sel/ctl select next;; $MODKEY-j) xwrite /sel/sel/ctl select next;; $MODKEY-k) xwrite /sel/sel/ctl select prev;; $MODKEY-Shift-h) xwrite /ctl select prev;; $MODKEY-Shift-l) xwrite /ctl select next;; $MODKEY-Shift-[0-9]) xwrite /ctl select `echo $1 | sed 's/.*-//'`;; $MODKEY-d) xwrite /sel/sel/sel/ctl sendtopage 0;; $MODKEY-a) xwrite /0/sel/sel/ctl sendtopage sel;; esac;; esac done & echo $! >$pidfile