]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Swap information
authorSergey Matveev <stargrave@stargrave.org>
Thu, 6 Aug 2020 11:38:10 +0000 (14:38 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Thu, 6 Aug 2020 13:44:10 +0000 (16:44 +0300)
bin/bin/xstatusbar.sh

index dc5c66c71954929f1ac5f5877c8eaf039d11171f..f2baf510cf9f97a3f4f385fe72ff39011b717130 100755 (executable)
@@ -6,6 +6,7 @@ while :; do
     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")"
+    swpinfo=$(echo "$topinfo" | perl -ne 'print $1 if /^Swap \w+ Total (\w+) Used/')
+    xsetroot -name "$swpinfo   $meminfo   $arcinfo   $fdm_state $life% $(date "+%Y-%m-%dT%H:%M:%S")"
     sleep 20
 done