Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@aspen-otr
Copy link

@aspen-otr aspen-otr commented Aug 4, 2025

Description

For any defpoll variable, if :interval is zero, then its script is called exactly one time, and not scheduled for any future executions.

Usage

Simply define something such as (defpoll username :interval 0 "echo $USER") and instead of continuously calling the echo $USER script (as is current behavior) it will instead just store $USER inside username. This is probably preferred as $USER should not change while eww is running.

Additional Notes

While week-long intervals and similar strategies exist, this creates a standard way to execute a command once for a variable. Fixes #883.

Checklist

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

  • All widgets I've added are correctly documented.
  • 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

fixes issue elkowar#883.
maybe can be casted from a string key of "once" instead for clarity?
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] Initialize basic variables with shell output

1 participant