Extend battery for desktop pc, fix icons

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2019-12-28 20:46:34 +01:00
parent ba151cf811
commit 91773e2d7f
Signed by: luzifer
GPG Key ID: DC2729FDD34BE99E
2 changed files with 11 additions and 3 deletions

View File

@ -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}"

View File

@ -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