Widgets are not updating their value's when conky's window is not focused.
doronbehar opened this issue · 8 comments
Hello @varingst,
I'm experiencing a hard to explain issue with this wonderful widget library. Perhaps I missed something with the initial setups configurations but the problem is this:
If I'm not focused on conky
's window, the values the widgets display are almost never updated.
Is there a workaround?
Hi, sorry about the late reply
What is your conky version?
Somewhere in the 1.09 -> 1.10 transition, there was a change in conky so that it would check if its Xwindow was visible (and not minimized), and halt its update loop if it wasn't. That in itself is a fine optimization, but the lua script hooks (which this hooks into to update over dbus) were tied to the X update loop, so it wouldn't run those scripts if it didn't plan on drawing to its Xwindow.
This has changed in later versions, I don't have those problems anymore. I'm currently running 1.10.6, and I don't need to have the window showing to have the widget updated.
If you are unable to update your conky to a newer version, you can do the following workaround in rc.lua
:
conky.properties.opacity = 0.0
conky.raise = function(c) c.opacity = 0.9 end
conky.lower = function(c) c.opacity = 0.0 end
The conky window will also need to be set sticky, which it is by default, so if you have conky.properties.sticky = false
set anywhere, remove it.
The result is that the window is always visible, so conky keeps its update loop running, but you won't see it with opacity set to 0. This will require a window compositor running though.
Hmm, I'm encountering this error: brndnmtthws/conky#422 I guess that's why the package wasn't updated in arch Linux official repositories.
I tried to write the lines you suggested above and I don't feel any difference. I putted them pretty much at the top of my rc.lua
. Is it the correct place to put these variables?
? I don't run arch, but 1.10.6 is in AUR, isn't it? https://www.archlinux.org/packages/?name=conky
Can you put up your rc.lua
and conkyrc
There are many versions of conky
in the AUR. I'm not totally sure what's the difference between them. I don't know if you are familiar with the concept but using the AUR means you are building the packages on your machine and I guess that due to the error I mentioned in my previous comment the official package isn't updated from 1.10.6_pre
to 1.10.6
.
Here's my .config/conky/conky.conf
and the relevant sections from my rc.lua
related to conky:
Being set after the section 'Error handling'.
-- {{{ Conky rules
conky.properties.opacity = 0.0
conky.properties.sticky = true
conky.raise = function(c) c.opacity = 0.9 end
conky.lower = function(c) c.opacity = 0.0 end
-- }}}
Widgets
mycpu = conky.widget({
icon = beautiful.widget_cpu,
conky = "${cpu}%"
})
myram = conky.widget({
icon = beautiful.widget_mem,
conky = "${memperc}%"
})
mygpu = conky.widget({
icon = beautiful.widget_temp,
conky = "${hwmon 0 temp 1}%"
})
mympd = conky.widget({
icon = beautiful.widget_music,
conky = "${mpd_smart}"
})
Being set after in the end of rules section:
-- Conky's rules
conky.rules()
}
My rc.lua
is also available for you to read but I havn't pushed the changes I listed above yet.
If it doesn't build from AUR then contact the package maintainer. I don't see anything obvious in the configs.
After you changed the properties, do you still need to have the window focused for it to update? Does the client window launch at 0 opacity? Is the window sticky now, is it all tags/workspaces? Does it change opacity and show when you use the client toggle button?
You are right, I have filed a bug report:
https://bugs.archlinux.org/task/56397
Edit: The behavior of conky's window is the same as it was before entering the aadditional configurations.
I still need to view an empty tag and see conky's window to update the widget. As for whether or not it's sticky, I would say it is sticky because it appears on all empty tags but if a client on a certain tag covers conky's window the widgets don't update their value. Regarding the opacity, if I understand the term correctly, I would say that it's 1
and I have not succeeded in making a client toggle button since #2 . I didn't feel like I needed those functions when you explained them to me in that issue.
If the changes are applied then the conky window should be invisible on launch. Are you sure you have a compositor running?
The whole workaround I gave you depends on having control over the window. You make the window always on screen to keep the update loop going, and then make it transparent to get it out of the way with the raise/lower functions. If you're going to do it this way and you need to have the window not hidden behind other windows for conky to update, just set the window to always on top.
If you don't have a need to control the actual window, you can try using other own_window_type
settings in conkyrc
, to see if conky will continuously update as i.e. desktop or panel.
Ultimately this is an issue internal to conky. You can try to get a workaround going based on my suggestions until you are able to upgrade, but I will not be constructing one by proxy while blindfolded, sorry.
Thanks a lot. I think we can close this issue.