Material Icons.
This commit is contained in:
parent
9e0d48b35f
commit
4508f38520
13 changed files with 121 additions and 117 deletions
|
@ -1,19 +1,17 @@
|
|||
#!/bin/sh
|
||||
#!/bin/bash
|
||||
|
||||
for battery in /sys/class/power_supply/BAT?*; do
|
||||
# If non-first battery, print a space separator.
|
||||
[ -n "${capacity+x}" ] && printf " "
|
||||
# Sets up the status and capacity
|
||||
case "$(cat "$battery/status")" in
|
||||
"Full") status="⚡" ;;
|
||||
"Discharging") status="🔋" ;;
|
||||
"Charging") status="🔌" ;;
|
||||
"Not charging") status="🛑" ;;
|
||||
"Unknown") status="♻️" ;;
|
||||
"Full") status="\uea0b" ;;
|
||||
"Discharging") status="\ue1a5" ;;
|
||||
"Charging") status="\ue63c" ;;
|
||||
"Not charging") status="\ue1a6" ;;
|
||||
"Unknown") status="\ue1a3" ;;
|
||||
esac
|
||||
capacity=$(cat "$battery/capacity")
|
||||
# Will make a warn variable if discharging and low
|
||||
[ "$status" = "🔋" ] && [ "$capacity" -le 25 ] && warn="❗"
|
||||
# Prints the info
|
||||
printf "%s %s%d%%" "$status" "$warn" "$capacity"; unset warn
|
||||
[ "$capacity" -le 20 ] && printf "\ue19c ^c#161616^^b#fd4285^${capacity}%%^d^" || printf "${status} ${capacity}%%"
|
||||
done && exit 0
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue