You are not logged in.

#1 2018-06-17 09:19:22

ghorvath
Member
Registered: 2015-10-01
Posts: 130

Use of update_interval_on_battery in default conky scripts

On laptops it would make sense to use the

update_interval_on_battery

option along with the usual

update_interval

setting.

For a laptop I would not want my conky draw that much resources, because I would want to use the battery life for more important things, but it is still useful to have some kind of a feedback from conky every once in a while. Right now the default conky setting is

update_interval = 1,

and I would say that when on battery, 2-3 seconds updates are more than enough not to drain the battery too fast with conky.
So my suggestion would be to add the extra line

update_interval_on_battery = 2,

into the default conky scripts. This would not make a difference for desktop machines, only for laptops when on batteries.

Offline

#2 2018-06-20 03:42:31

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 4,671
Website

Re: Use of update_interval_on_battery in default conky scripts

This sounds sensible.
Does conky take a significant % of total power consumption in a default BL system?
Any comments from conky people?


John
--------------------
( a boring Japan blog , Japan Links, idle twitterings  and GitStuff )
In case you forget, the rules.

Offline

#3 2018-06-20 04:07:54

ohnonot
...again
Registered: 2015-09-29
Posts: 3,191
Website

Re: Use of update_interval_on_battery in default conky scripts

my conky (a much expanded verison of the default, but no fancy lua stuff, just some conky graphs) runs at around 0.5% CPU on an intel i3 quad-core (ranging from 1 - 2.5 GHz).
measured with both conky and htop, 0.5% is my average. both apps report way below 1%.

Last edited by ohnonot (2018-06-20 04:08:08)

Offline

#4 2018-06-20 08:31:53

cloverskull
Member
Registered: 2015-10-01
Posts: 301

Re: Use of update_interval_on_battery in default conky scripts

Is there some way, maybe with powertop, that we can profile the actual power consumption over a set period of time?

Offline

#5 2018-06-20 14:55:33

sleekmason
Member
Registered: 2018-05-22
Posts: 142

Re: Use of update_interval_on_battery in default conky scripts

Is there some way, maybe with powertop, that we can profile the actual power consumption over a set period of time?

Here are a few ideas that could be expanded upon.
You can isolate the process in top by first getting the pid(s):

pgrep conky
930
931

and then:

top -p 930
top - 09:46:20 up 57 min,  2 users,  load average: 0.21, 0.39, 0.48
Tasks:   1 total,   0 running,   1 sleeping,   0 stopped,   0 zombie
%Cpu(s):  7.2 us,  2.3 sy,  0.0 ni, 90.3 id,  0.2 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  2008572 total,   226904 free,   861072 used,   920596 buff/cache
KiB Swap:  2148348 total,  2148348 free,        0 used.  1206040 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND         
  930 sleek     20   0  839920  12296   9196 S   0.0  0.6   0:15.05 conky  

To get really involved, you could use perf:



$ perf stat conky
conky: desktop window (b3) is root window
conky: window type - normal
conky: drawing to created window (0x2e00001)
conky: drawing to double buffer
conky: forked to background, pid is 10723

 Performance counter stats for 'conky':

         38.982774      task-clock:u (msec)       #    0.665 CPUs utilized          
                 0      context-switches:u        #    0.000 K/sec                  
                 0      cpu-migrations:u          #    0.000 K/sec                  
             1,165      page-faults:u             #    0.030 M/sec                  
        45,404,196      cycles:u                  #    1.165 GHz                    
        42,228,333      instructions:u            #    0.93  insn per cycle         
         8,468,147      branches:u                #  217.228 M/sec                  
           257,336      branch-misses:u           #    3.04% of all branches        

       0.058600452 seconds time elapsed

Here's a bunch of perf examples.   
Examples-for-perf


"Nothing in the world can take the place of Persistence. Talent will not; nothing is more common than unsuccessful men with talent. Genius will not; unrewarded genius is almost a proverb. Education will not; the world is full of educated derelicts. Persistence and determination alone are omnipotent." - Calvin Coolidge

Offline

#6 2018-06-20 21:26:08

unklar
Member
Registered: 2015-10-31
Posts: 734

Re: Use of update_interval_on_battery in default conky scripts

ghorvath wrote:
update_interval_on_battery = 2,

I think there's been a misunderstanding.
The command tells Conky to check the charging status of the battery every 2 seconds.
This has nothing to do with saving electricity.
If I am, then the order should be:

update_interval_on_battery = 20,

that's how I know, because Conky only does a correct evaluation after this time.

Generally I know that Conky causes a higher power consumption in syntax 1.10 than in syntax 1.9. However, this is negligible and depends on how many LUA scripts are used.

Offline

#7 2018-06-21 06:06:42

ohnonot
...again
Registered: 2015-09-29
Posts: 3,191
Website

Re: Use of update_interval_on_battery in default conky scripts

unklar wrote:

I think there's been a misunderstanding.
The command tells Conky to check the charging status of the battery every 2 seconds.

sorry, but you are wrong there.
the documentation for both 1.8 and 1.10 clearly says:

update_interval_on_battery    Update interval when running on batterypower

Offline

#8 2018-06-21 08:39:57

unklar
Member
Registered: 2015-10-31
Posts: 734

Re: Use of update_interval_on_battery in default conky scripts

Yeah, that's right.
That's exactly what I wrote.

Excuse me for not being a native speaker.   ops   smile

Offline

#9 2018-06-21 23:27:06

ohnonot
...again
Registered: 2015-09-29
Posts: 3,191
Website

Re: Use of update_interval_on_battery in default conky scripts

i wasn't blaming you or anything.
i'm not a native speaker myself.

just to clarify:
the update_interval_on_battery changes the update_interval to the value specified when running on battery.

if that's what you meant all along, then no harm done, eh?
"Doppelt genäht hält besser" wink

Last edited by ohnonot (2018-06-21 23:28:26)

Offline

#10 2018-06-22 10:01:47

unklar
Member
Registered: 2015-10-31
Posts: 734

Re: Use of update_interval_on_battery in default conky scripts

@ohnonot

absolutely right!
I dare not contradict you.   big_smile

Offline

#11 2018-11-29 14:53:59

Laadna
Member
Registered: 2017-09-15
Posts: 18

Re: Use of update_interval_on_battery in default conky scripts

Hello,

On my labtop the variable update_interval_on_battery does not work. It does not change anything when I also have update_interval (battery plugged or not), and behaves exactly like update_interval if left alone.

I think that is because my battery is BAT1 (tested with ${battery_time BAT0} and ${battery_time BAT1}, the first one displays nothing and the second one a proper timer). It looks like update_interval_on_battery checks only for BAT0.

Any advice ?

Last edited by Laadna (2018-11-29 14:55:40)

Offline

#12 2018-11-29 21:28:44

unklar
Member
Registered: 2015-10-31
Posts: 734

Re: Use of update_interval_on_battery in default conky scripts

I have no definite statement about your problem... hmm
https://github.com/brndnmtthws/conky/issues/190

But, look here, maybe it's helpful. You have to do handicrafts yourself   smile
https://forum.archlabslinux.com/t/simpl … -conky/594
https://forums.bunsenlabs.org/viewtopic … 931#p66931

Offline

#13 2018-11-30 00:01:51

Laadna
Member
Registered: 2017-09-15
Posts: 18

Re: Use of update_interval_on_battery in default conky scripts

Thanks. This command

 ls /sys/class/power_supply/ | grep BAT | head -n 1

definitly did something. Although, update_interval_on_battery keeps behaving the same way.

I may not be that smart. What do you suggest me to do with the two last links ?

Last edited by Laadna (2018-11-30 00:02:29)

Offline

#14 2018-11-30 07:54:48

damo
....moderator....
Registered: 2015-08-20
Posts: 4,376

Re: Use of update_interval_on_battery in default conky scripts

Laadna wrote:

...
I may not be that smart. What do you suggest me to do with the two last links ?

Read the code and see how the user is accessing the battery ( BAT0 or BAT1) in their conky


Be Excellent to Each Other...

FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Online

#15 2018-12-01 07:21:02

ohnonot
...again
Registered: 2015-09-29
Posts: 3,191
Website

Re: Use of update_interval_on_battery in default conky scripts

unklar wrote:

I have no definite statement about your problem... hmm
https://github.com/brndnmtthws/conky/issues/190

read all of it.
do you use
https://github.com/brndnmtthws/conky/pull/406
?

Offline

Board footer

Powered by FluxBB