-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AwesomeWM attempt to index nil value (field 'device') #1
Comments
Hello, To help debugging your issue, can you please provide a full stacktrace of the error thrown as well as a minimal reproducible code example (see https://awesomewm.org/doc/api/documentation/90-FAQ.md.html section "Where are logs, error messages or something?"). It would also help to know what version of awesome you use, and if you have correctly installed the dependencies listed at https://github.com/Aire-One/awesome-battery_widget#dependencies. |
My best guess right now is that this assignation awesome-battery_widget/init.lua Lines 118 to 120 in 48b83f4
went wrong for some reason. According to https://upower.freedesktop.org/docs/UPower-up-client.html#up-client-get-display-device, the function should return the device or NULL on error. So a basic check would be for you to run the The other possibility is that you have turned |
upower --enumerate does indeed return |
local battery_listener = upower_widget {
device_path = '/org/freedesktop/UPower/devices/battery_BAT0',
instant_update = true
} do you think this could be what was causing the issue |
Given you use the So, we need to investigate why this code fails : awesome-battery_widget/init.lua Lines 34 to 48 in 48b83f4
I can have two wild guesses on why it fails :
Hm... There is a third possibility where my code is bad here. I wrote it long ago, don't really remember how I did, and I can't find tests to validate it, so maybe the data-structure returned by get_devices is not iterable by this for loop 🤷 |
What about if do not have '/org/freedesktop/UPower/devices/battery_BAT0', im having the same error. |
First, make sure you actually don't have one by running In the case upower doesn't list a BAT0 entry, you indeed haven't one. You can replace the device_path by whatever upower says. I don't know what upower uses to name the devices, but it shouldn't be a big deal to use something else than BAT0. (I would however recommend using the display device as shown in the first README example with the parameter |
No description provided.
The text was updated successfully, but these errors were encountered: