small fix in portable detection, some systems have BAT1 but NOT BAT0, so now just check

if /sys/class/power_supply directory is empty or not.
This commit is contained in:
Harald Hope 2016-04-18 17:33:00 -07:00
parent 731508a93f
commit 14eb4aff0f

2
inxi
View file

@ -884,7 +884,7 @@ initialize_data()
else else
# found a case of battery existing but having nothing in it on desktop mobo # found a case of battery existing but having nothing in it on desktop mobo
# not all laptops show the first. /proc/acpi/battery is deprecated. # not all laptops show the first. /proc/acpi/battery is deprecated.
if [[ -n $( ls /proc/acpi/battery 2>/dev/null ) || -e /sys/class/power_supply/BAT0/ ]];then if [[ -n $( ls /proc/acpi/battery 2>/dev/null ) || -n $( ls /sys/class/power_supply/ 2>/dev/null ) ]];then
B_PORTABLE='true' B_PORTABLE='true'
fi fi
fi fi