diff --git a/.local/bin/statusbar/sb-battery b/.local/bin/statusbar/sb-battery index 468953c..e2423b9 100755 --- a/.local/bin/statusbar/sb-battery +++ b/.local/bin/statusbar/sb-battery @@ -25,7 +25,7 @@ notify() { \ fi [ 300 -gt $delta ] && return; echo $now > $XDG_CONFIG_HOME/batteryupdate - case "$capacity" in + case "$total" in [2-3][0-9]) notify-send -u "normal" "Battery is running low ($capacity%)" "Please plug your computer to a power source" ;; *) notify-send -u "critical" "Battery is dangerously low ($capacity%)" "Please plug your computer to a power source - NOW!" ;; esac @@ -38,7 +38,7 @@ do capacity="$(cat "$bat/capacity")" total="$(expr $total + $capacity)" slot="$(basename $bat)" - if [ "$status" = "Full" ]; then + if [ "Full" = "$status" ]; then status=" " && capacity="FULL" printf " %s:%s(%s) " "$slot" "$status" "$capacity" else @@ -52,8 +52,8 @@ do [2-3][0-9]) status="" ;; *) status="" ;; esac + [ 40 -gt $total ] && notify; fi - [ 40 -gt $total ] && notify; printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity"; fi done diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index fbc8235..2a91a64 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -12,8 +12,8 @@ # Wifi quality percentage and  icon if ethernet is connected. ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')" -ip="$(wpa_cli status | grep -i ^ip_address | sed -e 's/.*=//')" -[ -n $ip ] && str="$(printf " %s" $ssid)" || str="$(printf " ---")" +state="$(wpa_cli status | grep -i ^wpa_state | sed -e 's/.*=//')" +[ "COMPLETED" = $state ] && str="$(printf " %s" $ssid)" || str="$(printf " ---")" eth="$(cat /sys/class/net/enp0s31f6/operstate)" if [ "up" = "$eth" ]; then str="$(printf "%s /  " "$str")" diff --git a/.local/bin/statusbar/sb-music b/.local/bin/statusbar/sb-music index 0c64956..3c1dcc7 100755 --- a/.local/bin/statusbar/sb-music +++ b/.local/bin/statusbar/sb-music @@ -13,7 +13,7 @@ unicode() { sed "s/[‘’]/'/g;s/[“”]/\"/g"; } format() { sed "s/^volume:n\/a.*//g;/^volume:/d;s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//g"; } -mpc="$(mpc --format "%albumartist% - %title%")" +mpc="$(mpc --format "%artist% - %title%")" title="$(echo "$mpc" | head -n1 | cut -d'-' -f2 | unicode)" [ "$(echo "$title" | wc -c)" -gt 18 ] && title="$(printf "%.15s..." "$title")" artist="$(echo "$mpc" | head -n1 | cut -d'-' -f1 | unicode)"