You are not logged in.
Hello, sorry to distrub with this questions. Recently i was trying lot of wm hehe, and finally fall back to use Awesome again and using a GIT version from AUR now. I've got a problem when try to displaying a Battery Widget. I don't know which one is wrong, i use "vicious-git" also to make it balance with my awesome. Here's a config for my battery widget.
require("vicious")
local home = os.getenv("HOME")
-----------
^^baticon = wibox.widget.imagebox()
^^baticon.image = (home .. "/.config/awesome/icons/bat.png")
batwidget = wibox.widget.textbox()
^^vicious.register(batwidget, vicious.widgets.bat, "$1$2%", 61, "bat0")
--------------
local right_layout = wibox.layout.fixed.horizontal()
if s == 1 then right_layout:add(wibox.widget.systray()) end
right_layout:add(netwidget)
right_layout:add(batwidget)
right_layout:add(mytextclock)
right_layout:add(mylayoutbox[s])
The section with [ ^^ ] mark is the syntax that i'm not sure is correct, regarding on awesome wiki, also awesome-configs example from git.sysphere.org it must be look like this code below
baticon = widget({ type = "imagebox" })
baticon.image = image(beautiful.widget_bat)
-- Initialize widget
batwidget = widget({ type = "textbox" })
-- Register widget
vicious.register(batwidget, vicious.widgets.bat, "$1$2%", 61, "BAT0")
Which is will break all my awesome config. Well, i hope somebody who using awesome will help me thanks for the time to reading my post
Regards,
Last edited by hellnest (2011-01-25 16:08:30)
Offline
You shouldn't use git, 3.4.9 is fine, but since you do verify that image() in baticon did not change (like widget() did for your batwidget). This "bat0" is most likely wrong, verify in /sys/class/power_supply
You need to install an RTFM interface.
Offline
Offline
You updated the battery ID and it's still not working or what?
You need to install an RTFM interface.
Offline
Got it working now, without any state change. Only "charging" indicator and "0%" that shown in my systray. For the icons i already realize the problem. But the battery still doesn't work .
---
Update, i check from tty1 and got this error message
Tail.Call : ?
init.lua:63: in function 'update'
init.lua:156: in function </home/hellnest/.config/awesome/vicious/init.lua:155>
error bat.lua:66: attempt to perform arithmetic on a nill value
Last edited by hellnest (2011-01-25 15:14:32)
Offline
Offline
Your battery is the first that reports "no such device" for /sys/class/power_supply/BAT0/current_now. Without this information remaining (dis)charging time can not be calculated in the widget. This data could be available in another file, or another method, but this widget in its current form does not check for it. That's why it was throwing an exception.
You need to install an RTFM interface.
Offline
Sorry to put this up again, but I have a really similar problem.
Everything in my batwidget works, except it only shows N/A for remaining time. It used to work till a few weeks ago, though.
acpi is telling me correct values of remaining time.
my batwidget:
battext = widget({ type = "textbox", name = "battext" })
vicious.register(battext, vicious.widgets.bat, "BAT: $2% $3", 60, "BAT0")
the same syntax is working on my netbook on the same awesome and vicious versions
% ls /sys/class/power_supply/BAT0/
alarm energy_full_design power/ status uevent
cycle_count energy_now power_now subsystem@ voltage_min_design
device@ manufacturer present technology voltage_now
energy_full model_name serial_number type
so there is no current_now in here.
I was thinking I could try symlinking one of the power_now, energy_now, voltage_now files to current_now and see if something makes sense (should be power_now because I read somewhere about the units of these files), but I can't make symlinks there:
# ln -s energy_now current_now
ln: failed to create symbolic link `current_now': No such file or directory
EDIT: nevermind, I just edited /usr/share/awesome/lib/vicious/widgets/bat.lua to match power_now instead of current_now. Thanks anyway.
Last edited by Sin-H (2011-02-03 13:32:12)
Offline
Sorry to put this up again, but I have a really similar problem.
Everything in my batwidget works, except it only shows N/A for remaining time. It used to work till a few weeks ago, though.acpi is telling me correct values of remaining time.
my batwidget:
battext = widget({ type = "textbox", name = "battext" }) vicious.register(battext, vicious.widgets.bat, "BAT: $2% $3", 60, "BAT0")
the same syntax is working on my netbook on the same awesome and vicious versions
% ls /sys/class/power_supply/BAT0/ alarm energy_full_design power/ status uevent cycle_count energy_now power_now subsystem@ voltage_min_design device@ manufacturer present technology voltage_now energy_full model_name serial_number type
so there is no current_now in here.
I was thinking I could try symlinking one of the power_now, energy_now, voltage_now files to current_now and see if something makes sense (should be power_now because I read somewhere about the units of these files), but I can't make symlinks there:
# ln -s energy_now current_now ln: failed to create symbolic link `current_now': No such file or directory
EDIT: nevermind, I just edited /usr/share/awesome/lib/vicious/widgets/bat.lua to match power_now instead of current_now. Thanks anyway.
Glad it solved, try to pull latest vicious from git
Offline
Hellnest, do you have the power_now file?
You need to install an RTFM interface.
Offline
Sin-H, I talked with Hellnest and he does not have power_now. Can you tell me if your calculated time is sane, and really correct, not some crazy value?
You need to install an RTFM interface.
Offline
Implemented. According to this bug report (and commit) it is correct, and could replace current_now in the long run: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=532000
You need to install an RTFM interface.
Offline