1
0
Fork 0
mirror of https://github.com/Zedfrigg/ironbar.git synced 2025-07-12 15:31:03 +02:00

feat(config): use default fallback with config instructions

When no config file is found, the bar will now automatically instead load a hard-coded default consisting of the `focused` and `clock` modules, and a `label` informing you the bar is not configured. Instructions are also printed to the log.
This commit is contained in:
Jake Stanger 2023-07-03 22:47:36 +01:00
parent 1a272e00fb
commit 738b9e3da7
No known key found for this signature in database
GPG key ID: C51FC8F9CB0BEA61
6 changed files with 75 additions and 13 deletions

View file

@ -34,6 +34,17 @@ pub struct ClockModule {
pub common: Option<CommonConfig>,
}
impl Default for ClockModule {
fn default() -> Self {
ClockModule {
format: default_format(),
format_popup: default_popup_format(),
locale: default_locale(),
common: Some(CommonConfig::default()),
}
}
}
fn default_format() -> String {
String::from("%d/%m/%Y %H:%M")
}