support more devices

This commit is contained in:
eylles 2023-10-26 23:09:38 -06:00
parent 100ba5df59
commit bb2b552b46
No known key found for this signature in database
GPG Key ID: 87BB13678A662E19
1 changed files with 2 additions and 1 deletions

View File

@ -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 ]]
},