#!/bin/sh while :; do life=$(apm -l) [ -e /tmp/do-fdm ] && fdm_state="FM" || fdm_state="" topinfo=$(top -b -d 1 0 | sed s/[,:]//g) meminfo=$(echo "$topinfo" | grep "^Mem") arcinfo=$(echo "$topinfo" | grep "^ARC") xsetroot -name "$meminfo | $arcinfo | $fdm_state $life% $(date "+%Y-%m-%dT%H:%M:%S")" sleep 20 done