message check moved to top of bat
This commit is contained in:
parent
debbe40d2c
commit
809663bfa4
1 changed files with 9 additions and 11 deletions
|
@ -1,7 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
# Give a battery name (e.g. BAT0) as an argument.
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b>
|
||||
🔋: discharging
|
||||
♻: stagnant charge
|
||||
🔌: charging
|
||||
⚡: charged
|
||||
- Text color reflects charge left" ;;
|
||||
esac
|
||||
|
||||
capacity=$(cat /sys/class/power_supply/"$1"/capacity) || exit
|
||||
status=$(cat /sys/class/power_supply/"$1"/status)
|
||||
|
||||
|
@ -20,13 +28,3 @@ fi
|
|||
[ "$status" = "Charging" ] && color="#FFF"
|
||||
|
||||
printf "<span color='%s'>%s %s</span>" "$color" "$(echo "$status" | sed -e "s/,//g;s/Discharging/🔋/;s/Charging/🔌/;s/Unknown/♻️/;s/Full/⚡/;s/ 0*/ /g;s/ :/ /g")" "$(echo "$capacity" | sed -e 's/$/%/')"
|
||||
|
||||
case $BLOCK_BUTTON in
|
||||
3) pgrep -x dunst >/dev/null && notify-send "<b>🔋 Battery module:</b>
|
||||
🔋: discharging
|
||||
♻: stagnant charge
|
||||
🔌: charging
|
||||
⚡: charged
|
||||
- Text color reflects charge left" ;;
|
||||
esac
|
||||
|
||||
|
|
Loading…
Reference in a new issue