#!/bin/sh
while :; do
- life=$(apm -l)
flags="$(ls /tmp/stargrave-flags | perl -e 'print join " ", sort map { chomp and $_ } <>')"
topinfo=$(top -b -d 1 0 | sed s/[,:]//g)
meminfo=$(echo "$topinfo" | grep "^Mem")
arcinfo=$(echo "$topinfo" | grep "^ARC")
swpinfo=$(echo "$topinfo" | perl -ne 'print $1 if /^Swap \w+ Total (\w+) Used/')
- xsetroot -name "$swpinfo $meminfo $arcinfo [$flags] $life% $(date "+%Y-%m-%dT%H:%M:%S")"
+ xsetroot -name "$swpinfo $meminfo $arcinfo [$flags] $(date "+%Y-%m-%dT%H:%M:%S")"
sleep 20
done