saimoomedits / dotfiles

The ArchLinux and AwesomeWM configs. 📂
GNU General Public License v3.0
1.11k stars 47 forks source link

Battery error #27

Closed dung8466 closed 2 years ago

dung8466 commented 2 years ago

got error: /.config/awesome/mods/battery-widget/init.lua:125:attempt to index a nil value (field 'device') My spec: laptop msi modern 15 r5-5500u, amd radeon graphics Distro: Arch

kunihir0 commented 2 years ago

I got around this by commenting out the battery signal since I didn't need it for my machine

awesome/signal/init.lua

for my setup without a battery I had to remove some lines from the bar folder in layout/bar/init.lua, atm I am still getting rid of the battery stuff

I think down the road there needs to be a way to differentiate desktop users from laptop users

dung8466 commented 2 years ago

i'm on a laptop so i can't do that. is there another way to fix it?

unix-parrot commented 2 years ago

@dung8466 , did you install Upower? its probably cuz of that.

sudo pacman -S upower

dung8466 commented 2 years ago

i already installed upower so i don't think that the issue

unix-parrot commented 2 years ago

wierd, it works perfectly for me with no errors

kam1xgod commented 2 years ago

@dung8466, I don't really know if it will help in your case, but switching

use_display_device = false

in ~/.config/awesome/mods/battery-widget/init.lua (line 113) to

use_display_device = true

works for me.

According to README for UPower Battery Widget:

With the parameter use_display_device = true, the battery widget will automatically monitor the display device.

If you want to manually set which device to monitor, you can use the device_path parameter.

local my_battery_widget = battery_widget{
    screen = s,
    device_path = '/org/freedesktop/UPower/devices/battery_BAT0',
    widget_template = wibox.widget.textbox
}

Note: you can find it in

~/.config/awesome/mods/battery-widget/README.md
dung8466 commented 2 years ago

thank you. that work for me