Skip to content
Merged
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
10 changes: 4 additions & 6 deletions lmtt-modules/src/custom.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,13 @@ impl CustomModule {
cmd.arg(&mode).kill_on_drop(true);

// Keep any temp file alive until the script has finished
let _colors_file: Option<tempfile::NamedTempFile>;

if script.pass_as_env {
let _colors_file: Option<tempfile::NamedTempFile> = if script.pass_as_env {
for (key, value) in &scheme.colors {
let env_key = format!("LMTT_{}", key.to_uppercase());
cmd.env(env_key, value);
}
cmd.env("LMTT_MODE", &mode);
_colors_file = None;
None
} else {
let colors_json = serde_json::to_string(&scheme.colors)
.map_err(|e| lmtt_core::Error::Module(format!("JSON error: {}", e)))?;
Expand All @@ -412,8 +410,8 @@ impl CustomModule {
.map_err(|e| lmtt_core::Error::Module(format!("Temp file error: {}", e)))?;
tokio::fs::write(file.path(), colors_json).await?;
cmd.arg(file.path());
_colors_file = Some(file);
}
Some(file)
};

let output = tokio::time::timeout(clamp_timeout(script.timeout), cmd.output())
.await
Expand Down
3 changes: 3 additions & 0 deletions lmtt-modules/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,9 @@ pub struct ConfigFileInfo {
}

/// Standard trait that all theme modules must implement
// async_trait's expansion puts a bare `#[must_use]` on every async method,
// which clippy (1.99+) flags as `double_must_use`; it is the macro's doing.
#[allow(clippy::double_must_use)]
#[async_trait]
pub trait ThemeModule: Send + Sync {
/// Module name (e.g., "Waybar", "Hyprland")
Expand Down
Loading