Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a new eww command
force-poll
. Addresses #673Usage
Run
eww force-poll <pollvar>
oreww fp <pollvar>
. If the variable is a poll variable then it will manually run the associated command to update it or returns withNo poll var named <var> exists
orNo 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 specialupdate_poll_var()
function or havingupdate_global_variable()
take inOption<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.
docs/content/main
directory has been adjusted to reflect my changes.cargo fmt
to automatically format all code before committing