Merge branch 'dev' into gentoo
tweak statusbar: sb-battery displays slots sb-music display song artist, not album artist sb-internet display ssid, rather than wifi strength
This commit is contained in:
commit
39fe2c3a69
@ -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 - <b>NOW!</b>" ;;
|
||||
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
|
||||
|
@ -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")"
|
||||
|
@ -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)"
|
||||
|
Reference in New Issue
Block a user