From bb2b552b46bcfcee3ee19ed3c2053bc9494e6d88 Mon Sep 17 00:00:00 2001 From: eylles Date: Thu, 26 Oct 2023 23:09:38 -0600 Subject: [PATCH] support more devices --- battery-widget/battery.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/battery-widget/battery.lua b/battery-widget/battery.lua index fb1f336..f46766e 100644 --- a/battery-widget/battery.lua +++ b/battery-widget/battery.lua @@ -97,13 +97,14 @@ local function worker(user_args) elseif battery_backend == "upower" then awful.spawn.easy_async( { awful.util.shell, "-c", - [[ for battery in $(upower -e | grep 'battery\|headphone'); do + [[ for battery in $(upower -e | grep 'battery\|headphone\|phone\|headset'); do upower -i $battery | awk ' { if ($1 == "native-path:") {path=$2} else if ($1 == "percentage:") {percent=$2} else if ($1 == "state:") {state=$2} else if ($1 == "time") {time=$4" "$5} } END { sub("battery-","",path) } + END { sub("/org/bluez/","",path) } END { printf "%s:\n %s %s %s\n", path, percent, state, time }' ; done ]] },