You are not logged in.

#1 2011-04-15 10:02:27

szympro
Member
Registered: 2011-02-13
Posts: 18

Conky update_interval_on_battery problem, wrong BATx selected

I am having a small problem with conky configuration, with a update interval on battery function to be specific. When I insert it into conky config file, I get an error saying that BAT0 does not exist and therefore cannot be opened or found. This is true, as on my machine a battery is BAT1 as I have found out.
With functions for a battery bar or battery status user can set which battery should conky look for, but with the function mentioned above it is impossible (at least nothing is mentioned in manual). Can you help me with my problem?

Offline

#2 2011-04-19 19:06:13

szympro
Member
Registered: 2011-02-13
Posts: 18

Re: Conky update_interval_on_battery problem, wrong BATx selected

Still no ideas?

This is that I get when I manually start conky:

[~] conky
Conky: /home/archone/.conkyrc: 12: no such configuration: 'own_window_tpe'
Conky: desktop window (aa) is root window
Conky: window type - normal
Conky: drawing to created window (0x1400001)
Conky: drawing to double buffer
Conky: can't open /sys/class/power_supply/BAT0/uevent: No such file or directory
Conky: can't open /proc/acpi/battery/BAT0/state: No such file or directory
Conky: can't open /proc/apm: No such file or directory
^CConky: received SIGINT or SIGTERM to terminate. bye!
[~] 

Offline

#3 2011-04-19 21:03:03

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Conky update_interval_on_battery problem, wrong BATx selected

Have you tried writing it like this:

update_interval_on_battery 10 BAT1

I have no idea if it would work, but I don't think the arguments for configurations work all that differently than the arguments for variables.  Sorry, I'm away from my machine or else I would have tested it for you.

Last edited by the sad clown (2011-04-19 21:03:44)


I laugh, yet the joke is on me

Offline

#4 2011-04-19 21:59:50

szympro
Member
Registered: 2011-02-13
Posts: 18

Re: Conky update_interval_on_battery problem, wrong BATx selected

Yes the sad clown, that was one of the first things I have tried, but with no effect. But I have not checked

update_interval_on_battery BAT1 10

. I will try it in a second.

EDIT: I am not getting any error, but the function is not working, probably because is has wrong argument - BAT1 insted of n seconds. Still no luck sad

Last edited by szympro (2011-04-19 22:02:53)

Offline

#5 2011-04-20 00:18:08

the sad clown
Member
From: 192.168.0.X
Registered: 2011-03-20
Posts: 837

Re: Conky update_interval_on_battery problem, wrong BATx selected

I think you are going to have to edit the source code on conky to change the default on this option.  You can probably do this if you install it via ABS.

I'll mess with it when I get home and report back.

Edit: Sorry, I had a look at it, but it's more complex than I have time for at the moment.  I've found a couple of files that need to be changed (conky.c and linux.c), but there is more to it than that.

Last edited by the sad clown (2011-04-20 04:55:42)


I laugh, yet the joke is on me

Offline

#6 2011-04-21 00:23:09

szympro
Member
Registered: 2011-02-13
Posts: 18

Re: Conky update_interval_on_battery problem, wrong BATx selected

Too bad sad I have just written at conky support on sourceforge, maybe someone will be able to answer.

Offline

#7 2014-05-24 17:44:09

charlie89
Member
Registered: 2014-05-24
Posts: 3

Re: Conky update_interval_on_battery problem, wrong BATx selected

I know this Thread is plain old, but since nobody was able to find the solution, i just have to post that here.

The files core.c and conky.c have BAT0 hardcoded, so all you have to do is changing that to BAT1 (or BAT2 or whatever your battery is named).
Just add the following lines in the build() Section of the PKGBUILD to fix the issue:

sed -i 's/BAT0/BAT1/' src/core.c
sed -i 's/BAT0/BAT1/' src/conky.c

Oh and conky needs up to ~20 seconds to recognize the power change (and therefore change the update interval) wink

Offline

Board footer

Powered by FluxBB