Potentially fix showing battery on desktops

The battery indicator should only be shown on devices with a battery
power supply. It should not be shown when a wireless USB device is
attached that happens to have a battery. This patch potentially fixes
the issue of showing a 0% battery reading on desktops.
This commit is contained in:
Kenneth Benzie 2023-06-23 22:40:27 +01:00
parent 201ba38b2a
commit 78afc517ba

View File

@ -28,7 +28,7 @@ else
}
fi
if [[ "$(acpi -b 2>&1 /dev/null)" != "No support for device type: power_supply" ]]; then
if upower -e | grep 'BAT' 2> /dev/null; then
function get_battery {
local output=$(acpi -b)
local charging=$(echo $output | awk '{ print $3 }')