corrected wrong $OLD_PATH, and removed $PIDFILE hack

This commit is contained in:
salva 2006-03-10 23:50:49 +00:00
parent 2b618491e0
commit d93fc75863
2 changed files with 10 additions and 16 deletions

View File

@ -1,7 +1,7 @@
#!/usr/local/plan9/bin/rc
# clean the environment and execute the given command
path=$old_path
path=$OLD_PATH
old_path=()
apid=()
cmd=()

View File

@ -1,12 +1,7 @@
#!/usr/local/plan9/bin/rc
# configure wmii
PIDFILE=/tmp/ns.$USER.$DISPLAY/`{basename $0}^'pid'
fn xwrite {a=$1; shift; echo -n $* | wmiir write $a}
if(test -r $PIDFILE)
kill `{cat $PIDFILE}
echo $pid >$PIDFILE
MODKEY=Alt
WMII_FONT='fixed'
WMII_NORMCOLORS='#222222 #eeeeee #666666'
@ -27,9 +22,9 @@ wmiir write /def/rules <<END
END
# BAR CONFIGURATION
wmiir create /bar/foo
xwrite /bar/foo/colors $WMII_SELCOLORS
xwrite /bar/expand foo
wmiir create /bar/spare
xwrite /bar/spare/colors $WMII_SELCOLORS
xwrite /bar/expand spare
# MENU CONFIGURATION
fn items {ls -lpL $* | awk '!/^d/ && $1 ~ /x/ {print $NF}'| sort | uniq}
@ -87,7 +82,7 @@ oldt=''
wmiir read /event|
while(e=`{read}) {
switch($e(1)) {
case NT
case NewTag
t=$e(2)
wmiir create /bar/$t
if(~ $t $olt)
@ -95,23 +90,23 @@ while(e=`{read}) {
if not
xwrite /bar/$"t/colors $WMII_SELCOLORS
xwrite /bar/$"t/data $e(2)
case RT
case RemoveTag
wmiir remove /bar/$e(2)
case TF
case FocusTag
t=$e(2)
if (! ~ $#oldt 0)
xwrite /bar/$oldt/colors $WMII_SELCOLORS
xwrite /bar/$t/data $e(2)
xwrite /bar/$t/colors $WMII_NORMCOLORS
oldt=$e(2)
case LB
case LabelClick
xwrite /ctl select $e(2)
case K
case Key
switch($e(2)) {
case $MODKEY-Control-c
xwrite /ws/sel/sel/ctl kill
case $MODKEY-Control-w,y
wmiirc&
exec wmiirc
case $MODKEY-Control-q,y
xwrite /ctl quit
case $MODKEY-Control-p
@ -158,4 +153,3 @@ while(e=`{read}) {
}
}
} &
echo $apid >$PIDFILE