-
-
Notifications
You must be signed in to change notification settings - Fork 612
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
Substitute for $pre_exec for 2.0.0pre and higher? #62
Comments
You should note that 2.0.0pre is pretty much a rewrite, rather than a |
Frankly, I did read about this reasoning, but it made not the slightest sense to me. Generate what? How? Why? Before removing such important and well-established variable, I do expect from the person who removes it an explanation that goes beyond a terse, incomprehensibly "murmured" phrase. Since in fact it will mean that zillions of scripts worldwide will have to be modified. And yes, I'm now "back" to 1.9.1 (git), since 2.0.0pre is way too far off: while I was able to transform my old .conkyrc to the new LUA format, I regret to say that transparency doesn't work anymore in v2pre, but shows black although this is not the actual black background color. (Changed it to something weird and it stayed black, hence I assumed the black is due to the malfunctioning transparency.) |
The sentence I quoted suggests that the thought was that the config is lua, |
Which is already the gist of my plead. OK, if 2.0.0pre is really just meant to play around with ... no problem BUT then 1.9.1 ought to be 'master' and 2.0.0pre should be given something in the sense of 'experimental'. Because git newbies might simply mistake the 2.0.0pre for "latest devel" without being aware of the fact that seemingly "old" 1.9.1 is still actively developed; and above all that this is the only devel version meant to be used. |
Forwarding a bug report (#791718) I received from a Debian user: I noticed that the pre_exec variable has been removed, without The commit description says that the pre_exec variable has been removed Oh well, if one knew how to program in Lua, one could use Lua I failed to find any relevant explanation on how Lua could be used My attempt (after converting my .conkyrc to the new Lua-based syntax)
Unfortunately, it does not work and I do not know why. Thanks for your time! P.S.: my current workaround is to use execi with a long interval:
It's much simpler than any Lua-based solution, but it does not |
@Vincent-C It's not working for your script is because the function ain't getting call. Basically just call the conky.text = [[
a lot of stuff...
${color green}
]];
o = io.popen('fortune -s | cowsay', 'r')
conky.text = conky.text .. o:read('*a') @labath Honestly, I am rather disappointed at how long this issue is left unaddressed, with no basic example since it's your commit which removed it. everyone else: conky.text is just a string, http://lua-users.org/wiki/StringsTutorial an basic function which takes a string, execute it and return the output require 'io'
function pre_exec(cmd)
local handle = io.popen(cmd)
local output = handle:read("*a")
handle:close()
return output
end usage: conky.text = pre_exec("lsb_release -sd || cat /etc/*release")..[[
${hr}
System $alignr ${nodename}
Kernel ${alignr} ${kernel}
-- additional stuff
]] |
@su8 Thoughts? |
You can close this issue, as the |
Okay, we'll close this issue. I think we need to document well-demonstrated examples in the man page sooner or later because this is still going to be confusing for everybody. Then again, everybody I know is still confused with their life. |
Even after reading this a couple of times, I am still confused about where to put the function, how to concatenate so that the text is in the middle of the output, not just at the beginning, how to align the text as desired, how to format it and probably a lot more. This leaves more open questions than it should. |
This is a very trivial issue if you look at it - we want to run anything only once - it depends on a few issues::
If you give This command or any LUA script will get evaluated every
Even though I have created a LUA alternative - (every conky function can be re-created in LUA with a very tiny overhead as compared to the original C++ code) - I no longer use it as I give a rather large time interval if use So if we agree - then |
@plikhari: You leave out the option that whatever is run with ${pre_exec} can only be run at startup. Trivial example: The time the computer was booted, or a sensor value at startup. If you re-run this, the value will be wrong. If you really want to get rid of ${pre_exec}, although I cannot see a reason myself, please document the replacement option well. In this case, it should be option 1: ${execi} 10000 for things which can be repeated and option 2: whatever lua offers for things which should only run once, period. Please keep in mind that most users of conky use it once to set their configuration and afterwards don't touch it for a very long time. This would help a lot of people out there. The new way is not as intuitive as the old option was. |
It is not that anyone wants to get rid of
That was the basic understanding for A simple This will behave exactly like
|
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. |
Well, I've just encountered by testing my fresh build with some old .conkyrc config files, that $pre_exec got removed at some point.
Why, actually?
$exec and friends do NOT do what I want, because I really only want to execute a certain shell command ONCE.
And $pre_exec was perfect for this task. So I wonder why the decision got made to remove a great feature that has been implemented since 2004.
The text was updated successfully, but these errors were encountered: