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:
parent
201ba38b2a
commit
78afc517ba
@ -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 }')
|
||||
|
Loading…
x
Reference in New Issue
Block a user