mirror of
https://github.com/0intro/wmii
synced 2024-12-29 14:49:43 +03:00
24 lines
554 B
Bash
24 lines
554 B
Bash
#!/usr/local/plan9/bin/rc
|
|
# periodically print date and load average to the bar
|
|
PIDFILE=/tmp/ns.$USER.$DISPLAY/`{basename $0}^'pid'
|
|
|
|
if(test -r $PIDFILE)
|
|
kill `{cat $PIDFILE}
|
|
echo $pid >$PIDFILE
|
|
|
|
wmiir create /bar/status
|
|
xwrite /bar/status/colors $WMII_NORMCOLORS
|
|
# install signal handler for artificial sigexit:
|
|
fn sigint {
|
|
if(test -f $PIDFILE && ~ `{cat $PIDFILE} $pid)
|
|
rm -f $PIDFILE
|
|
echo $PIDFILE sigint
|
|
wmiir remove /bar/status
|
|
exit
|
|
}
|
|
|
|
while(text=`{date | sed 's/GMT .*//'} xwrite /bar/status/data $"text){
|
|
sleep 2
|
|
} &
|
|
echo $apid > $PIDFILE
|