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
|
# Requires reboot: Red
|
||||||
(echo "${updates}" | grep -qE "^($(get_grep))") && color="#dd0000"
|
(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
|
#!/bin/bash
|
||||||
set -euo pipefail
|
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'
|
IFS=$'\n'
|
||||||
|
|
||||||
ac_conn=0
|
ac_conn=0
|
||||||
|
@ -26,7 +32,9 @@ done
|
||||||
IFS=' '
|
IFS=' '
|
||||||
|
|
||||||
if [ ${ac_conn} -eq 0 ]; then
|
if [ ${ac_conn} -eq 0 ]; then
|
||||||
printf '\uf58d %s\n' "${bat_cap[*]}"
|
# PS not connected, on battery
|
||||||
|
printf '\uf241 %s\n' "${bat_cap[*]}"
|
||||||
else
|
else
|
||||||
printf '\uf740 %s\n' "${bat_cap[*]}"
|
# PS connected, on AC
|
||||||
|
printf '\uf376 %s\n' "${bat_cap[*]}"
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue