Battery: Add support for Bay Trail devices (axp288_fuel_gauge)
This commit is contained in:
parent
15451a5283
commit
d8e1150e19
1 changed files with 13 additions and 15 deletions
14
neofetch
14
neofetch
|
@ -1833,17 +1833,13 @@ get_disk() {
|
|||
get_battery() {
|
||||
case "$os" in
|
||||
"Linux")
|
||||
# We use 'prin' here and exit the function early so that we can
|
||||
# do multi battery support with a single battery per line.
|
||||
for bat in "/sys/class/power_supply/BAT"*; do
|
||||
# We use 'prin' here so that we can do multi battery support
|
||||
# with a single battery per line.
|
||||
for bat in "/sys/class/power_supply/"{BAT,axp288_fuel_gauge}*; do
|
||||
capacity="$(< "${bat}/capacity")"
|
||||
status="$(< "${bat}/status")"
|
||||
|
||||
# Fix for bash on Windows 10 which includes /proc files
|
||||
# for battery usage despite there not being a battery
|
||||
# installed.
|
||||
[[ -z "$capacity" ]] && return
|
||||
|
||||
if [[ "$capacity" ]]; then
|
||||
battery="${capacity}% [${status}]"
|
||||
|
||||
case "$battery_display" in
|
||||
|
@ -1852,7 +1848,9 @@ get_battery() {
|
|||
"barinfo") battery="$(bar "$capacity" 100)${info_color} ${battery}" ;;
|
||||
esac
|
||||
|
||||
bat="${bat/*axp288_fuel_gauge}"
|
||||
prin "${subtitle:+${subtitle}${bat: -1}}" "$battery"
|
||||
fi
|
||||
done
|
||||
return
|
||||
;;
|
||||
|
|
Loading…
Reference in a new issue