From fa9a7c94298043682e9d3abe52f924c7d7f72a42 Mon Sep 17 00:00:00 2001 From: Morgan McMillian Date: Wed, 7 Apr 2021 12:50:24 -0700 Subject: [PATCH] detect the correct battery object --- bin/statusbar | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/statusbar b/bin/statusbar index cdf2303..3e59ea7 100755 --- a/bin/statusbar +++ b/bin/statusbar @@ -2,8 +2,9 @@ #DATE=$(while date +'%Y-%m-%d %l:%M:%S %p'; do sleep 1; done) DATE=$(date +'%Y-%m-%d %k:%M') -POWER="| $(upower -i /org/freedesktop/UPower/devices/battery_BAT|grep percentage|awk '{print $2}')" -BSTATE=$(upower -i /org/freedesktop/UPower/devices/battery_BAT|grep state|awk '{print $2}') +BATTERY=$(upower --enumerate|grep battery) +POWER="| $(upower -i $BATTERY|grep percentage|awk '{print $2}')" +BSTATE=$(upower -i $BATTERY|grep state|awk '{print $2}') # fully-charged 🔌 # charging ⚡