]> Sergey Matveev's repositories - dotfiles.git/commitdiff
Memory information in dwm status bar
authorSergey Matveev <stargrave@stargrave.org>
Wed, 5 Aug 2020 13:59:34 +0000 (16:59 +0300)
committerSergey Matveev <stargrave@stargrave.org>
Wed, 5 Aug 2020 13:59:34 +0000 (16:59 +0300)
bin/bin/xstatusbar.sh [new file with mode: 0755]
x/.xinitrc

diff --git a/bin/bin/xstatusbar.sh b/bin/bin/xstatusbar.sh
new file mode 100755 (executable)
index 0000000..dc5c66c
--- /dev/null
@@ -0,0 +1,11 @@
+#!/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
index 89f7c19bc54d7ff8e7209e3e02b392650118aad4..37078780311c70562e5e59c9ef3ba8916c9c0699 100755 (executable)
@@ -4,12 +4,7 @@ xsetroot -solid \#222222 &
 xset b off
 # xrdb ~/.Xresources
 xmodmap ~/.Xmodmap
-while :; do
-    life=$(apm -l)
-    [ -e /tmp/do-fdm ] && fdm_state="FM" || fdm_state=""
-    xsetroot -name "$fdm_state $life% $(date "+%Y-%m-%dT%H:%M:%S")"
-    sleep 20
-done &
+~/bin/xstatusbar.sh &
 rm -f ~/.ssh/agent ; ssh-agent -a ~/.ssh/agent
 ~/bin/cleanup.sh
 exec $HOME/src/suckless/dwm/dwm