From 17bcc246a3515b838a7cd61bb9b0b745ef0f67bd Mon Sep 17 00:00:00 2001 From: Sergey Matveev Date: Wed, 5 Aug 2020 16:59:34 +0300 Subject: [PATCH] Memory information in dwm status bar --- bin/bin/xstatusbar.sh | 11 +++++++++++ x/.xinitrc | 7 +------ 2 files changed, 12 insertions(+), 6 deletions(-) create mode 100755 bin/bin/xstatusbar.sh diff --git a/bin/bin/xstatusbar.sh b/bin/bin/xstatusbar.sh new file mode 100755 index 0000000..dc5c66c --- /dev/null +++ b/bin/bin/xstatusbar.sh @@ -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 diff --git a/x/.xinitrc b/x/.xinitrc index 89f7c19..3707878 100755 --- a/x/.xinitrc +++ b/x/.xinitrc @@ -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 -- 2.44.0