######################################################################################################### # !/bin/sh # # Stylin Greymon's WMFS status.sh script # # This status script was made with the 'cure' font in mind, and will need adjusting to fit other fonts. # ######################################################################################################### _date() { date="`LC_ALL="en_EN.UTF-8" date '+%a %d %b %Y'`" date="\\#d5d5d5\\$date \\#6eb0cc\\:::\\#d5d5d5\\$HOUR `date '+%I:%M'`\\#6eb0cc\\ ::" } _memory() { memory_free="`free -m | grep "buffers/" | awk {'print $3MB'}`" memory="\\#6eb0cc\\:: \\#85919b\\MEM\\#393939\\:\\#d5d5d5\\ $memory_free\\#6eb0cc\\ ::" } _mpd() { ############ # mpd info # # is required for "now playing" informations # if [ "`mpc 2>&1 | wc -l`" -gt "1" ]; then if [ "`mpc | grep "^\[paused\]"`" != "" ]; then mpd_current=" \\#85919b\\PAUSED \\#d5d5d5\\`mpc current`" else mpd_current=" \\#85919b\\PLAYING \\#d5d5d5\\`mpc current`" fi else mpd_current=" \\#85919b\\MPD \\#d5d5d5\\[stopped]" fi mpd="\\#85919b\\$mpd_current \\#6eb0cc\\::" # ############ } _battery() { REM=`awk '/remaining capacity/ { print $3 }' /proc/acpi/battery/BAT0/state` LAST=`awk '/last full/ { print $4}' /proc/acpi/battery/BAT0/info` bat_percent=$(echo $REM $LAST | awk '{printf "%d", ($1/$2)*100'}) bat_acpi=`cat /sys/class/power_supply/BAT0/status` if [ "$bat_acpi" = "Discharging" ]; then bat_state="\\#9e2f3e\\[BAT]" elif [ "$bat_acpi" = "Charging" ]; then bat_state="\\#8ab534\\[AC]" fi # Blink if % < 15 (since my battery is mostly dead i will probably never see the blink :D) if [ "$bat_percent" -lt "15" ]; then bat_fail=1 if [ "`cat /tmp/batteryfail`" ]; then color="\\#9e2f3e\\" echo 0 > /tmp/batteryfail else color="\\#96824b\\" echo 1 > /tmp/batteryfail fi else bat_fail=0 color="\\#d5d5d5\\" fi battery="\\#85919b\\POW\\#393939\\:$color $bat_percent% $bat_state" } _volume() { volume="\\#85919b\\VOL\\#d5d5d5\\ `amixer | grep "Master" -A 5 | grep -o "\[.*%" | sed "s/\[//" | sed 's/%//'`" } statustext() { # concat args for arg in $@; do _${arg} args="${args} `eval echo '$'$arg`" done wmfs -s 0 "$args" } statustext mpd volume memory date battery