From 78afc517bad38fd37599ce099e33a02d8f0ee662 Mon Sep 17 00:00:00 2001 From: "Kenneth Benzie (Benie)" Date: Fri, 23 Jun 2023 22:40:27 +0100 Subject: [PATCH] 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. --- system-info/system-info-Linux.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system-info/system-info-Linux.sh b/system-info/system-info-Linux.sh index 024e0b5..043abaf 100755 --- a/system-info/system-info-Linux.sh +++ b/system-info/system-info-Linux.sh @@ -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 }')