X-Git-Url: https://git.xandkar.net/?a=blobdiff_plain;f=bin%2Fkhatus_show;h=da35e6ea325ff8d07f65dee6f498842346b4c838;hb=a256fc3d8137adacc5870cb1fcc8de55cfaf3479;hp=4e90c48c14d998942d6421043b12249b5604d201;hpb=0ca0fd63a00c21f3f127054401bb27f729d89abc;p=khatus.git diff --git a/bin/khatus_show b/bin/khatus_show index 4e90c48..da35e6e 100755 --- a/bin/khatus_show +++ b/bin/khatus_show @@ -7,6 +7,8 @@ STATUS_DIR=$HOME/var/run/status STATUS_FILE__WIFI=$STATUS_DIR/wifi STATUS_FILE__ENERGY_NOTIFIED_BELLOW_HALF=$STATUS_DIR/notified_energy_bellow_half +SYMBOL_WIFI='📶' + #load=$(cat /proc/loadavg | awk '{printf "%4.2f %4.2f %4.2f", $1, $2, $3}') fan=$(awk '/^speed:/ {printf "%4d", $2}' /proc/acpi/ibm/fan) @@ -70,7 +72,7 @@ disk=$( io_net=$( awk ' BEGIN { - bytes_per_unit = 1024 + bytes_per_unit = 1024 * 1024 } NR > 2 { @@ -91,7 +93,7 @@ io_net=$( print curr_read > prev_read_file; print curr_write > prev_write_file; - printf("%s %0.0f▲ %0.0f▼\n", device, diff_write, diff_read); + printf("%s %0.3f▲ %0.3f▼\n", device, diff_write, diff_read); } ' /proc/net/dev ) @@ -289,6 +291,29 @@ signal_last_msg_age=$( | tr -d ' ' ) +mpd_state=$( + echo 'status' \ + | nc 127.0.0.1 6600 \ + | awk ' + { + status[$1] = $2 + } + + END { + state = status["state:"] + symbol = "-" + if (state == "play") { + symbol = "▶" + } else if (state == "pause") { + symbol = "❚❚" + } else if (state == "stop") { + symbol = "⬛" + } + printf("%s", symbol) + } + ' +) + echo \ "\ E$energy\ @@ -297,23 +322,24 @@ echo \ M$memory\ \ \ - D$disk\ - \ - \ C=[$cpu ${temp}°C ${fan}rpm]\ \ \ - S=$screen_brightness\ + D$disk\ \ \ - V=$volume\ + $SYMBOL_WIFI [$wifi $(echo "$io_net" | awk '/^wlp3s0/ {print $2, $3}')]\ \ \ B:$bluetooth_power\ \ \ - W:[$wifi $(echo "$io_net" | awk '/^wlp3s0/ {print $2, $3}')]\ + S=$screen_brightness\ + \ + \ + V=$volume\ \ + $mpd_state\ \ $signal_last_msg_age\ \