]> Sergey Matveev's repositories - dotfiles.git/blob - bin/bin/xstatusbar.sh
Swap information
[dotfiles.git] / bin / bin / xstatusbar.sh
1 #!/bin/sh
2
3 while :; do
4     life=$(apm -l)
5     [ -e /tmp/do-fdm ] && fdm_state="FM" || fdm_state=""
6     topinfo=$(top -b -d 1 0 | sed s/[,:]//g)
7     meminfo=$(echo "$topinfo" | grep "^Mem")
8     arcinfo=$(echo "$topinfo" | grep "^ARC")
9     swpinfo=$(echo "$topinfo" | perl -ne 'print $1 if /^Swap \w+ Total (\w+) Used/')
10     xsetroot -name "$swpinfo   $meminfo   $arcinfo   $fdm_state $life% $(date "+%Y-%m-%dT%H:%M:%S")"
11     sleep 20
12 done