Skip to content
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

feat: add subcommand to force-poll variable #1227

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

tokinanpa
Copy link

@tokinanpa tokinanpa commented Nov 14, 2024

Description

This PR adds a subcommand to the CLI to manually poll a polling variable:

eww poll [NAMES]...

This command will force the variable to be polled outside of its interval. It will also ignore :run-while conditions.
An error will be thrown if the variable isn't defined with defpoll (or if it doesn't exist, obviously).

Resolves #1005

Additional Notes

This is my first time contributing, and I haven't been able to fully ensure that this code works as intended. Suggestions and bug fixes would be greatly appreciated.

Checklist

  • I added my changes to CHANGELOG.md.
  • The documentation in the docs/content/main directory has been adjusted to reflect my changes.
  • I used cargo fmt to automatically format all code before committing

w-lfchen

This comment was marked as resolved.

@tokinanpa
Copy link
Author

  1. currently, the command silently ignores non-existent variables, same if no variables are given at all.

Strange, I thought I handled the case where the variable doesn't exist. I'll have to look at that again.

@tokinanpa
Copy link
Author

@w-lfchen As far as I can tell, the behavior of eww update and eww poll are exactly the same here. Neither print an error message to stderr when called with a nonexistent variable, they both put an error message in the logs. The update subcommand also does nothing when called with no arguments.
Is there something I'm missing?

@w-lfchen
Copy link
Contributor

w-lfchen commented Nov 16, 2024

Is there something I'm missing?

my bad, i was a bit tired and mixed up eww update and eww get.
i still think that both shouldn't silently fail but copying eww update's behavior is the correct thing to do here imo.

Copy link
Contributor

@w-lfchen w-lfchen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks good, thank you for your work! <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Manually trigger defpoll variable update
2 participants