-
-
Notifications
You must be signed in to change notification settings - Fork 622
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
conditional exec always executed #334
Comments
Quote the values like
See if this works. |
Hi thanks for your reply. Unfortunately that doesn't seem to make any difference. I don't think there is a problem with the condition, as I have also put some test text inside conditional block and it is not displayed, like so:
I am not seeing TEST TEST displayed but the execi is still being executed. This confirms the condition is evaluating false. If I change the condition so it evaluates true (change 10 to 1000) then TEST TEST is displayed and the execi is still executed. I have also tested using an if_existing as follows:
TEST is displayed, and execi is executed.
TEST is not displayed, but execi is executed. |
Fantastic have a look at the issue I raised #318 All of the if_ conky variables will only print or not print within the condition - depending on true or false. These if_ conditions do not stop any execution of a command with So to work around this - you saw my work around there - using shell to figure things out. From a common sense point of view - if the condition is false then the following code should not be evaluated at all. |
Thanks for pointing to a workaround @plikhari All this stems from the way callbacks are handled now. Visible output from conky objects respects I know this explanation doesn't fix the situation, but hopefully it sheds some light as to why it happens. |
Hey @marcpayne - Many thanks for that information. I figured this by going through the source code. But at some point in time - we need to find a way to handle these issues - as my workaround will only work with tangible things that shell can look at - like in my case - check if a file exists. |
And if you chain the command with anti-slash, like this : |
@dbriba sorry to report that adding the \ has not had any affect. @plikhari thanks for the idea, I now use a bash scrip to do the test and play the sound. I may as well use ACPI events at this point, or a battery monitor. I guess conky isn't really the right place to be doing this sort of stuff. I'm happy now anyway. Shall I leave this issue open for your reference? Sounds like you may want to change this behaviour as it kind of defies logic, and also breaks backward compatibility of some configs, in a kind of hard to debug way. Anyway, up to you all now, feel free to close if you are want. Thanks :) |
Excuse me, why do you use a template inside a condition? |
You can use the actual file name here - it is just that - when you are handling 20+ template files - it helps to know which external sources I am checking or using. I use a script to feed the template variables used for each template file into the help docs. I am referring to the documentation for conkywx - my weather program. |
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. |
I have a conditional execi, but since updating from 1.9.0 to 1.10.5 the execi is ALWAYS executed, even when the condition is FALSE.
I have tried exec too and the exhibits the same behaviour.
I have put some text inside the conditional block and it is not displayed, confirming the condition evaluates false, however the exec is still executed.
The text was updated successfully, but these errors were encountered: