Is it possible to change update interval in Conky for specific variables?

6

Is it possible to change the update interval in Conky for specific variables? Can I change it just like I would change the font in a Conky?

Akilan

Posted 2010-07-14T07:42:41.070

Reputation: 528

Answers

3

As far as I know, conky has a single update_interval parameter which applies to all of the running .conkyrc file.

If you want some parameters to be monitored at different intervals, use a separate rc file and run 2 (or more) instances of conky.

Patkos Csaba

Posted 2010-07-14T07:42:41.070

Reputation: 1 542

oh oh.. :( how does running two instances of conky with half the items monitored by each compare with running only one instance with all items combined? For simplicity sake let us assume all three instances use same update_interval. – Akilan – 2010-07-16T10:10:39.717

Conky is pretty light on resources. So if you don't update tens of parameters every second, you shouldn't see more thant 2-3% extra CPU usage for running the same amount of items as you current conky, but split in 3 conky processes.

Also, if you plan to split it to reduce cpu usage by rarely changing but frequently updated parameters, running several conky processes is a good way.

Also, with more processes, you can place each wherever you want on your screen. – Patkos Csaba – 2010-07-16T11:17:34.453

11

I was googling the same thing and this came up as a result so I wanted to set it straight.

It IS possible to do so, conky provides the following :

execi Same as exec but with specific interval. Interval can't be less than update_interval in configuration. See also $texeci

Usage: ${execi time-in-second bash-command-here}

Reference: http://conky.sourceforge.net/variables.html

cete3

Posted 2010-07-14T07:42:41.070

Reputation: 211

1

Short answer: It is not possible when sticking to conky's built in variables and functions alone.

Long answer: There is a way. First of all, what Csaba said in the other comment, is not entirely true: So if you don't update tens of parameters every second, you shouldn't see more thant 2-3% extra CPU usage. It's not necessarily about amounts of parameters. You might already require update_interval to be set to 0.5 or smaller, if you use just one mere line of scrolling text (like in my case). Try it out yourself. Scrolling text will run literally at snail's pace at standard value of update_interval.

But you won't want other things to update as hectically as this (except for graphs perhaps), so what can you do?

Outsource the code which needs to be in a greater interval. Even though some conky functions might exist for it, use replacement functions from bash (or even Python), put them in a script and ${execi} respectively ${texeci} them with your desired greater interval. In some cases, you may as well want to use ${execpi} resp. ${texecpi} since the latter two will also allow you to use a line like echo "${color aabbcc}" in a bash script parsed by conky for built-in parameters / variables.

syntaxerror

Posted 2010-07-14T07:42:41.070

Reputation: 505