diff --git a/crates/eww/src/util.rs b/crates/eww/src/util.rs index afbfcc6..3660b94 100644 --- a/crates/eww/src/util.rs +++ b/crates/eww/src/util.rs @@ -116,6 +116,7 @@ pub fn parse_scss_from_file(path: &Path) -> Result { grass::from_string(file_content, &grass_config).map_err(|err| anyhow!("Encountered SCSS parsing error: {:?}", err)) } + #[ext(pub, name = StringExt)] impl> T { /// check if the string is empty after removing all linebreaks and trimming diff --git a/crates/yuck/src/config/script_var_definition.rs b/crates/yuck/src/config/script_var_definition.rs index a67afbb..8687d3e 100644 --- a/crates/yuck/src/config/script_var_definition.rs +++ b/crates/yuck/src/config/script_var_definition.rs @@ -36,7 +36,7 @@ impl ScriptVarDefinition { pub fn command_span(&self) -> Option { match self { ScriptVarDefinition::Poll(x) => match x.command { - VarSource::Shell(span, _) => Some(span), + VarSource::Shell(span, ..) => Some(span), VarSource::Function(_) => None, }, ScriptVarDefinition::Listen(x) => Some(x.command_span), @@ -70,11 +70,6 @@ impl FromAstElementContent for PollScriptVar { let mut attrs = iter.expect_key_values()?; let initial_value = Some(attrs.primitive_optional("initial")?.unwrap_or_else(|| DynVal::from_string(String::new()))); let interval = attrs.primitive_required::("interval")?.as_duration()?; - let timeout = attrs - .primitive_optional::("timeout")? - .map(|x| x.as_duration()) - .transpose()? - .unwrap_or_else(|| std::time::Duration::from_millis(200)); let (script_span, script) = iter.expect_literal()?; iter.expect_done()?; Self { diff --git a/docs/src/configuration.md b/docs/src/configuration.md index 3b8bcb9..70dc1dd 100644 --- a/docs/src/configuration.md +++ b/docs/src/configuration.md @@ -155,8 +155,7 @@ They may also be useful to have buttons within eww change what is shown within y ```lisp (defpoll time :interval "1s" - :timeout "0.1s" ; setting timeout is optional - :initial "initial-value" ; setting timeout is optional + :initial "initial-value" ; setting initial is optional `date +%H:%M:%S`) ``` @@ -166,9 +165,6 @@ This may be the most commonly used type of variable. They are useful to access any quickly retrieved value repeatedly, and thus are the perfect choice for showing your time, date, as well as other bits of information such as your volume. -Optionally, you can specify a timeout, after which the provided script will be aborted. -This helps to avoid accidentally launching thousands of never-ending processes on your system. - You can also specify an initial-value, this should prevent eww from waiting for the result of a give command during startup, thus, making the startup time faster.