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
Make button invisible if plugin returns no output #54
Conversation
This might be counter intuitive as no output would likely be an script error that should be visible. |
I agree with @aggsol |
Just a quick update: I haven't really made up my mind about this PR yet, but I won't be adding any more settings than there already are. |
What do you think about considering also the exit code of the plugin and hiding the indicator only when the exit code is 0 and the output is empty? In case of an error the plugin should have an exit code != 0. |
@matthias-g What are you trying to achieve? It seems that you actually want to create something like a notification. |
I didn't verify, but from looking at plugins like the Notmuch inbox & unread counter I assume that BitBar hides the button when there is no output or the first line of the output is "---". If that is true, adopting this behavior would be part of implementing BitBar compatibility. |
@matthias-g Hiding the button when there is no output is problematic for the reason mentioned by @aggsol, but I like the idea of hiding it if the first line is a separator. I would merge a PR that implements that. |
Hide the button only if there are no lines above the first separator. (see p-e-w#54)
OK. I've added a commit that hides the button when the first line is a separator, but keeps showing the button when there is no output at all. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After addressing the above comments, please also squash everything into a single commit. Alternatively, I can do a squash when merging.
a024acc
to
893adc0
Compare
Thanks for the comments! I've performed the requested changes and squashed the commits. |
Merged. Thank you for seeing this through, @matthias-g. This is definitely an improvement! |
This hides the indicator for a plugin if the plugin returns no output (see #49).