Cleanup and comments
This commit is contained in:
17
jstat
17
jstat
@@ -4,18 +4,27 @@ xsetroot -name "Loading ..."
|
||||
|
||||
while (true); do
|
||||
#set date: 04.03 15:22
|
||||
timedate=$(date +"%m.%d %H:%M")
|
||||
|
||||
## memory in use
|
||||
#mem=$(free -m | grep Mem | awk '{print $7}')
|
||||
|
||||
## load average
|
||||
#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")
|
||||
if [ ! -z "$check_play" ]; then
|
||||
play=$(mpc status | head -n 1)
|
||||
play="$(mpc status | head -n 1) |"
|
||||
vol="[$(mpc vol | cut -c 8-)]"
|
||||
else
|
||||
#otherwise hide it
|
||||
vol=""
|
||||
play=""
|
||||
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;
|
||||
done
|
||||
|
||||
Reference in New Issue
Block a user