hastinbe / i3blocks-battery-plus

An enhanced battery status indicator for i3blocks
GNU General Public License v2.0
34 stars 5 forks source link

Syntax error when running from cmd #2

Closed Warkorentin closed 3 years ago

Warkorentin commented 3 years ago

Hi. I've been trying to use this script but can't get it to run correctly, even from a terminal. I installed all the dependencies but it doesn't seem to be the issue. I'm not a developer, could you point me in the right direction ?

Here is the output that I'm getting :

image

Thanks !

hastinbe commented 3 years ago

Sure, it looks like it's not able to get your current battery level. It could be that it's configured with an invalid battery (the instance in your config). A quick way is to run the command upower -e and look for symbols ending with battery*, and specify what's after the as the instance value. Example:

$ upower -e
/org/freedesktop/UPower/devices/line_power_AC0
/org/freedesktop/UPower/devices/battery_BAT0
/org/freedesktop/UPower/devices/mouse_hidpp_battery_0
/org/freedesktop/UPower/devices/DisplayDevice

So I would then change my i3blocks.conf to use

[battery-plus]
instance=BAT0
Warkorentin commented 3 years ago

That's it !

acpi -b returned :

Battery 0: Discharging, 91%, 07:04:12 remaining

So I assumed that I had to set my instance to BAT0, but upower -e gives me :

$ upower -e
/org/freedesktop/UPower/devices/line_power_AC /org/freedesktop/UPower/devices/battery_BAT1 /org/freedesktop/UPower/devices/line_power_ucsi_source_psy_USBC000o001 /org/freedesktop/UPower/devices/DisplayDevice

I switched from BAT0 to BAT1 and it now runs perfectly. Thanks a lot !