]> Sergey Matveev's repositories - dotfiles.git/blob - bin/bin/xstatusbar.sh
Huge tmux-fzf simplification with files quoting
[dotfiles.git] / bin / bin / xstatusbar.sh
1 #!/bin/sh
2
3 while :; do
4     life=$(apm -l)
5     flags="$(ls /tmp/stargrave-flags | perl -e 'print join " ", sort map { chomp and $_ } <>')"
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 [$flags] $life% $(date "+%Y-%m-%dT%H:%M:%S")"
11     sleep 20
12 done