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
|
fi
|
||||||
[ 300 -gt $delta ] && return;
|
[ 300 -gt $delta ] && return;
|
||||||
echo $now > $XDG_CONFIG_HOME/batteryupdate
|
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" ;;
|
[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>" ;;
|
*) notify-send -u "critical" "Battery is dangerously low ($capacity%)" "Please plug your computer to a power source - <b>NOW!</b>" ;;
|
||||||
esac
|
esac
|
||||||
@ -38,7 +38,7 @@ do
|
|||||||
capacity="$(cat "$bat/capacity")"
|
capacity="$(cat "$bat/capacity")"
|
||||||
total="$(expr $total + $capacity)"
|
total="$(expr $total + $capacity)"
|
||||||
slot="$(basename $bat)"
|
slot="$(basename $bat)"
|
||||||
if [ "$status" = "Full" ]; then
|
if [ "Full" = "$status" ]; then
|
||||||
status=" " && capacity="FULL"
|
status=" " && capacity="FULL"
|
||||||
printf " %s:%s(%s) " "$slot" "$status" "$capacity"
|
printf " %s:%s(%s) " "$slot" "$status" "$capacity"
|
||||||
else
|
else
|
||||||
@ -52,8 +52,8 @@ do
|
|||||||
[2-3][0-9]) status="" ;;
|
[2-3][0-9]) status="" ;;
|
||||||
*) status="" ;;
|
*) status="" ;;
|
||||||
esac
|
esac
|
||||||
fi
|
|
||||||
[ 40 -gt $total ] && notify;
|
[ 40 -gt $total ] && notify;
|
||||||
|
fi
|
||||||
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
|
printf " %s:%s (%0.2d%%) " "$slot" "$status" "$capacity";
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
@ -12,8 +12,8 @@
|
|||||||
|
|
||||||
# Wifi quality percentage and icon if ethernet is connected.
|
# Wifi quality percentage and icon if ethernet is connected.
|
||||||
ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')"
|
ssid="$(wpa_cli status | grep -i ^ssid | sed -e 's/.*=//')"
|
||||||
ip="$(wpa_cli status | grep -i ^ip_address | sed -e 's/.*=//')"
|
state="$(wpa_cli status | grep -i ^wpa_state | sed -e 's/.*=//')"
|
||||||
[ -n $ip ] && str="$(printf " %s" $ssid)" || str="$(printf " ---")"
|
[ "COMPLETED" = $state ] && str="$(printf " %s" $ssid)" || str="$(printf " ---")"
|
||||||
eth="$(cat /sys/class/net/enp0s31f6/operstate)"
|
eth="$(cat /sys/class/net/enp0s31f6/operstate)"
|
||||||
if [ "up" = "$eth" ]; then
|
if [ "up" = "$eth" ]; then
|
||||||
str="$(printf "%s / " "$str")"
|
str="$(printf "%s / " "$str")"
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
unicode() { sed "s/[‘’]/'/g;s/[“”]/\"/g"; }
|
unicode() { sed "s/[‘’]/'/g;s/[“”]/\"/g"; }
|
||||||
format() { sed "s/^volume:n\/a.*//g;/^volume:/d;s/\\&/&/g;s/\\[paused\\].*//g;s/\\[playing\\].*//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)"
|
title="$(echo "$mpc" | head -n1 | cut -d'-' -f2 | unicode)"
|
||||||
[ "$(echo "$title" | wc -c)" -gt 18 ] && title="$(printf "%.15s..." "$title")"
|
[ "$(echo "$title" | wc -c)" -gt 18 ] && title="$(printf "%.15s..." "$title")"
|
||||||
artist="$(echo "$mpc" | head -n1 | cut -d'-' -f1 | unicode)"
|
artist="$(echo "$mpc" | head -n1 | cut -d'-' -f1 | unicode)"
|
||||||
|
Reference in New Issue
Block a user