-
-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed lua script is reloaded however lua_startup_hook is not called again #366
Comments
So I just figured out that it is possible to 'rewrite' the conky config file which will trigger a restart. Therefore this issue is not that important ... Maybe I'll try to fix it as soon as I install the git version of conky. |
I have same problem with lua_startup_hook.
And I call it in my conky with:
In the doc I can see:
The problem is the script is not relaunched when conky is reloaded (in my case it is every 600 seconds). The script is just launch one time when I launch my conky, and it's all. It is normal or it's a bug ? |
The startup hook is working as designed. It is called the very first time conky is started - it will not be called on save or on any of the exec set of calls. Perhaps you are using an incorrect hook - you should be using Just a recap -
|
Ok plikhari, I know that. When I used conky 1.9, the pre_exec variable made the job, without problem. All of conky's users are not able to write a lua-script. |
OK - I am the developer of conkywx [a fantastic weather program] and since 2013 - I have used lua to exceed the boundaries of what is normally possible with vanilla conky. As of now I am in the process of releasing conkywx SIX - just sorting out one of the templates - which is playing hard to get lol
I have absolutely no issues with writing lua scripts - so what is it that I am doing different ?? Try this - create a bash script - you use this to launch or restart conky. To background a conky process you can use a -d option or place & at the end of the line. This gives a very flexible way to get a fresh conky start while you can mess around with lua or which ever scripting you prefer to use. I have always used this method way before I started using lua with conky. The main engine for conkywx is in You can run this script from a terminal or bind it to a key sequence etc
Now regarding pre_exec - you can write a simple script in lua - OR - give a larger time interval to the (t)exec(p)(i) set of calls - 6 hours or 24 hours - you get the same result. The process is run once over an interval - which could be the lifetime of the process or a large enough time that it really would not matter if the process was restarted. |
Give a large interval don't make the job for me. |
Can you please share the code - what you want to achieve - perhaps I can then see - there may be yet another way to reach your goal. Please include from start to finish when you expect your data displayed. |
Thank for your post, but I try other thing, and that work (with crondtab). |
What's the status of this issue? Thank you. |
I am testing 1.10.9_pre - and This issue should be closed. |
@plikhari Thank you for testing this. 😍 🔥 This seems to working okay here for me too... as designed.
conky.config = {
out_to_x=false,
out_to_console=true,
lua_load = '~/conky/write_to_file.lua',
lua_startup_hook = 'write',
}
conky.text = [[
${exec date}
]]
function conky_write()
os.execute("date >> /tmp/date.log")
end
It also seems like there were several issues that was simply solved by upgrading to at least I triggered a new bug testing this too. 🤕 I'll file an issue shortly. 😉 |
This issue is pretty annoying when writing new lua scripts which use the startup hook to set things up. When a script changes, conky (lua?) will load the new version upon save but the startup hook will NOT be called once again, therefore is is always necessary to restart conky after some changed to a script (at least in my version which is debian's testing version 1.10.6)
The text was updated successfully, but these errors were encountered: