Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ All notable changes to eww will be listed here, starting at changes since versio
- Add `value-pos` to scale widget (By: ipsvn)
- Add `floor` and `ceil` function calls to simplexpr (By: wsbankenstein)
- Add `formatbytes` function calls to simplexpr (By: topongo)
- Add support for polling a variable only once (By: aspen-otr)

## [0.6.0] (21.04.2024)

Expand Down
4 changes: 4 additions & 0 deletions crates/eww/src/script_var_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,10 @@ impl PollVarHandler {
crate::error_handling_ctx::print_error(err);
}

if var.interval.is_zero() {
return;
}

crate::loop_select_exiting! {
_ = cancellation_token.cancelled() => break,
_ = tokio::time::sleep(var.interval) => {
Expand Down
2 changes: 2 additions & 0 deletions docs/src/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,8 @@ and thus are the perfect choice for showing your time, date, as well as other bi
You can also specify an initial-value. This should prevent eww from waiting for the result of a given command during startup, thus
making the startup time faster.

If the specified interval is `0` or `"0s"`, then the polling variable will only poll its script automatically once, when initialized.

To externally update a polling variable, `eww update` can be used like with basic variables to assign a value.
You can also call `eww poll` to poll the variable outside of its usual interval, or even while it isn't running at all.

Expand Down