Extend battery for desktop pc, fix icons
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
ba151cf811
commit
91773e2d7f
2 changed files with 11 additions and 3 deletions
|
@ -31,4 +31,4 @@ display_num=""
|
|||
# Requires reboot: Red
|
||||
(echo "${updates}" | grep -qE "^($(get_grep))") && color="#dd0000"
|
||||
|
||||
printf '<span color="%s">\uf94f%s</span>\n' "${color}" "${display_num}"
|
||||
printf '<span color="%s">\uf0ad%s</span>\n' "${color}" "${display_num}"
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
#!/bin/bash
|
||||
set -euo pipefail
|
||||
|
||||
# Check no support for battery (likely desktop PC)
|
||||
acpi -b |& grep -q 'No support' && {
|
||||
printf '\uf0e7\n'
|
||||
exit 0
|
||||
} || true
|
||||
|
||||
IFS=$'\n'
|
||||
|
||||
ac_conn=0
|
||||
|
@ -26,7 +32,9 @@ done
|
|||
IFS=' '
|
||||
|
||||
if [ ${ac_conn} -eq 0 ]; then
|
||||
printf '\uf58d %s\n' "${bat_cap[*]}"
|
||||
# PS not connected, on battery
|
||||
printf '\uf241 %s\n' "${bat_cap[*]}"
|
||||
else
|
||||
printf '\uf740 %s\n' "${bat_cap[*]}"
|
||||
# PS connected, on AC
|
||||
printf '\uf376 %s\n' "${bat_cap[*]}"
|
||||
fi
|
||||
|
|
Loading…
Reference in a new issue