You are not logged in.

#1 2011-01-25 14:05:07

hellnest
Member
From: $ dmesg | grep ATA
Registered: 2010-11-11
Posts: 194
Website

[(SOLVED)] <Awesome GIT> Battery Widget syntax change?

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 smile thanks for the time to reading my post

Regards,

Last edited by hellnest (2011-01-25 16:08:30)


roll Snapping my own life roll
hmmgithubhmm
coolMyBlogcool

Offline

#2 2011-01-25 14:30:56

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

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

#3 2011-01-25 14:36:40

hellnest
Member
From: $ dmesg | grep ATA
Registered: 2010-11-11
Posts: 194
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

Thanks for the response, in /sys/class/power_supply there's AC and BAT0. Hmm if i revert to normal version it's mean i must modify my network widget setting right?


roll Snapping my own life roll
hmmgithubhmm
coolMyBlogcool

Offline

#4 2011-01-25 14:40:01

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

You updated the battery ID and it's still not working or what?


You need to install an RTFM interface.

Offline

#5 2011-01-25 14:47:15

hellnest
Member
From: $ dmesg | grep ATA
Registered: 2010-11-11
Posts: 194
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

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

here's the ss for example
tNzVjcQ

Last edited by hellnest (2011-01-25 15:14:32)


roll Snapping my own life roll
hmmgithubhmm
coolMyBlogcool

Offline

#6 2011-01-25 15:54:04

hellnest
Member
From: $ dmesg | grep ATA
Registered: 2010-11-11
Posts: 194
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

Solved it on IRC, thanks anxrc. The problem is there's no information provided from my notebook to give readout a result


roll Snapping my own life roll
hmmgithubhmm
coolMyBlogcool

Offline

#7 2011-01-25 16:09:08

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

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

#8 2011-02-03 11:54:29

Sin-H
Member
Registered: 2010-10-25
Posts: 12

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

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

#9 2011-02-04 09:21:28

hellnest
Member
From: $ dmesg | grep ATA
Registered: 2010-11-11
Posts: 194
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

Sin-H wrote:

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 smile


roll Snapping my own life roll
hmmgithubhmm
coolMyBlogcool

Offline

#10 2011-02-06 08:05:59

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

Hellnest, do you have the power_now file?


You need to install an RTFM interface.

Offline

#11 2011-02-11 07:12:16

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

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? smile


You need to install an RTFM interface.

Offline

#12 2011-02-15 05:02:30

anrxc
Member
From: Croatia
Registered: 2008-03-22
Posts: 834
Website

Re: [(SOLVED)] <Awesome GIT> Battery Widget syntax change?

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

Board footer

Powered by FluxBB