Add example config
This commit is contained in:
@ -14,11 +14,21 @@ const DIALOG_TIMEOUT: Duration = Duration::from_secs(60);
|
||||
fn main() -> anyhow::Result<()> {
|
||||
init_logging("BSCREENSAVER_DIALOG_GTK3_LOG");
|
||||
|
||||
let mut new_login_command = load_configuration()?.and_then(|config_toml| {
|
||||
config_toml.get("new-login-command")
|
||||
.and_then(|nlc| nlc.as_str().map(|s| s.to_string()))
|
||||
.map(|nlc| shell_words::split(&nlc))
|
||||
}).transpose()?.filter(|nlc| !nlc.is_empty());
|
||||
let config_tomls = load_configuration()?;
|
||||
let mut config_tomls_iter = config_tomls.into_iter().rev();
|
||||
let mut new_login_command: Option<Vec<String>> = loop {
|
||||
if let Some(config_toml) = config_tomls_iter.next() {
|
||||
if let Some(nlc) = config_toml.get("new-login-command")
|
||||
.and_then(|nlc| nlc.as_str().map(|s| s.to_string()))
|
||||
.map(|nlc| shell_words::split(&nlc))
|
||||
.transpose()?
|
||||
{
|
||||
break Some(nlc);
|
||||
}
|
||||
} else {
|
||||
break None;
|
||||
}
|
||||
};
|
||||
|
||||
let standalone = std::env::var("BSCREENSAVER_DIALOG_STANDALONE").is_ok();
|
||||
|
||||
|
Reference in New Issue
Block a user