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

Add force-poll command #910

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

Add force-poll command #910

wants to merge 2 commits into from

Conversation

ZaheenJ
Copy link

@ZaheenJ ZaheenJ commented Sep 2, 2023

Description

Adds a new eww command force-poll. Addresses #673

Usage

Run eww force-poll <pollvar> or eww fp <pollvar>. If the variable is a poll variable then it will manually run the associated command to update it or returns with No poll var named <var> exists or No script var named <var> exists if a regular variable named var doesn't exist either.

Additional Notes

I am not very familiar with rust and I marked run_poll_once() as public as it seemed a lot nicer than having a special update_poll_var() function or having update_global_variable() take in Option<DynVal> and checking there, is that fine? Also would it make sense to have a special interval for defpolls 'once' that never updates except when force-polled? I would personally use this for brightness as opposed to having a 1hr interval or something. Also particularly for brightness, if this is merged I feel like it would make sense to have a magic variable EWW_BRIGHTNESS that takes in a display, similar to how EWW_BATTERY takes in a battery.

Checklist

Please make sure you can check all the boxes that apply to this PR.

  • All widgets I've added are correctly documented (None added).
  • I added my changes to CHANGELOG.md, if appropriate.
  • 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

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.

1 participant