This commit is contained in:
jmb05
2026-11-02 17:26:51 +01:00
parent cdfc5b8d36
commit 11fb03427c
7 changed files with 94 additions and 94 deletions

View File

@@ -1,4 +1,5 @@
use serde::Deserialize;
use std::default::Default;
use std::fs;
#[derive(Deserialize, Debug, Clone, Default)]
@@ -10,8 +11,7 @@ impl Config {
pub fn load() -> Config {
fs::read_to_string("jmb-bar.conf")
.ok()
.map(|s| toml::from_str::<Config>(&s).ok())
.flatten()
.and_then(|s| toml::from_str::<Config>(&s).ok())
.unwrap_or_default()
}
}
@@ -33,7 +33,8 @@ impl Default for IdleConfig {
dim_timeout: 60,
lock_timeout: 300,
sleep_timeout: 320,
..Default::default()
lock_command: String::default(),
sleep_command: String::default(),
}
}
}