Cleanup and comments

This commit is contained in:
jon
2019-02-23 14:37:45 -06:00
parent b08ac49ef0
commit f1556103c6

17
jstat
View File

@@ -4,18 +4,27 @@ xsetroot -name "Loading ..."
while (true); do while (true); do
#set date: 04.03 15:22 #set date: 04.03 15:22
timedate=$(date +"%m.%d %H:%M")
## memory in use
#mem=$(free -m | grep Mem | awk '{print $7}') #mem=$(free -m | grep Mem | awk '{print $7}')
## load average
#loadavg=$(cat /proc/loadavg | awk '{print $1 " " $2 " " $3}') #loadavg=$(cat /proc/loadavg | awk '{print $1 " " $2 " " $3}')
#xsetroot -name "$mem | $loadavg | $timedate"
# check if mpd is playing
# if yes, output volume and song
check_play=$(mpc status | grep "playing") check_play=$(mpc status | grep "playing")
if [ ! -z "$check_play" ]; then if [ ! -z "$check_play" ]; then
play=$(mpc status | head -n 1) play="$(mpc status | head -n 1) |"
vol="[$(mpc vol | cut -c 8-)]" vol="[$(mpc vol | cut -c 8-)]"
else else
#otherwise hide it
vol="" vol=""
play="" play=""
fi fi
timedate=$(date +"%m.%d %H:%M")
xsetroot -name "$vol $play | $timedate" # final output to status bar
xsetroot -name "$vol $play $timedate"
sleep 0.5; sleep 0.5;
done done