mirror of
https://github.com/0intro/wmii
synced 2024-11-25 23:30:24 +03:00
23 lines
485 B
Bash
23 lines
485 B
Bash
#!/bin/sh
|
|
# periodically print date and load average to the bar
|
|
|
|
pidfile=/tmp/ns.$USER.$DISPLAY/statuspid
|
|
|
|
xwrite() {
|
|
file="$1"; shift
|
|
echo -n "$@" | wmiir write "$file"
|
|
}
|
|
|
|
# race condition alert
|
|
test -f $pidfile && kill `cat $pidfile` 2>/dev/null
|
|
echo $$ >$pidfile
|
|
sleep 1
|
|
wmiir create /bar/status
|
|
xwrite /bar/status/colors $WMII_NORMCOLORS
|
|
trap "wmiir remove /bar/status 2>/dev/null; exit" 15
|
|
|
|
while xwrite /bar/status/data `date` `uptime | sed 's/.*://; s/,//g'`
|
|
do
|
|
sleep 1
|
|
done
|