Update icons for battery
This commit is contained in:
@@ -1,15 +1,15 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Prints all batteries, their percentage remaining and an emoji corresponding
|
# Prints all batteries, their percentage remaining and an emoji corresponding
|
||||||
# to charge status (🔌 for plugged up, 🔋 for discharging on battery, etc.).
|
# to charge status ( for plugged up, for discharging on battery, etc.).
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
3) notify-send "🔋 Battery module" "🔋: discharging
|
3) notify-send " Battery module" ": discharging
|
||||||
🛑: not charging
|
: not charging
|
||||||
♻: stagnant charge
|
: stagnant charge
|
||||||
🔌: charging
|
: charging
|
||||||
⚡: charged
|
: charged
|
||||||
❗: battery very low!
|
: battery very low!
|
||||||
- Scroll to change adjust xbacklight." ;;
|
- Scroll to change adjust xbacklight." ;;
|
||||||
4) xbacklight -inc 10 ;;
|
4) xbacklight -inc 10 ;;
|
||||||
5) xbacklight -dec 10 ;;
|
5) xbacklight -dec 10 ;;
|
||||||
@@ -22,15 +22,18 @@ for battery in /sys/class/power_supply/BAT?*; do
|
|||||||
[ -n "${capacity+x}" ] && printf " "
|
[ -n "${capacity+x}" ] && printf " "
|
||||||
# Sets up the status and capacity
|
# Sets up the status and capacity
|
||||||
case "$(cat "$battery/status")" in
|
case "$(cat "$battery/status")" in
|
||||||
"Full") status="⚡" ;;
|
"Full") status="" ;;
|
||||||
"Discharging") status="🔋" ;;
|
"Discharging") status="" ;;
|
||||||
"Charging") status="🔌" ;;
|
"Charging") status="" ;;
|
||||||
"Not charging") status="🛑" ;;
|
"Not charging") status="" ;;
|
||||||
"Unknown") status="♻️" ;;
|
"Unknown") status="" ;;
|
||||||
esac
|
esac
|
||||||
capacity=$(cat "$battery/capacity")
|
capacity=$(cat "$battery/capacity")
|
||||||
# Will make a warn variable if discharging and low
|
# Will make a warn variable if discharging and low
|
||||||
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
|
[ "$status" = "" ] && [ "$capacity" -le 75 ] && status=""
|
||||||
|
[ "$status" = "" ] && [ "$capacity" -le 50 ] && status=""
|
||||||
|
[ "$status" = "" ] && [ "$capacity" -le 25 ] && status=""
|
||||||
|
[ "$status" = "" ] && [ "$capacity" -le 10 ] && status=""
|
||||||
# Prints the info
|
# Prints the info
|
||||||
printf "%s%s%d%%" "$status" "$warn" "$capacity"; unset warn
|
printf "%s %d%%" "$status" "$capacity";
|
||||||
done && exit 0
|
done && exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user