eww icon indicating copy to clipboard operation
eww copied to clipboard

Add force-poll command

Open ZaheenJ opened this issue 1 year ago • 0 comments

Description

Adds a new eww command force-poll. Addresses https://github.com/elkowar/eww/issues/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).
  • [X] I added my changes to CHANGELOG.md, if appropriate.
  • [X] The documentation in the docs/content/main directory has been adjusted to reflect my changes.
  • [X] I used cargo fmt to automatically format all code before committing

ZaheenJ avatar Sep 02 '23 09:09 ZaheenJ