mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-02 11:11:04 +02:00
refactor(config): use universal-config
crate.
XML config is not supported.
This commit is contained in:
parent
01a36a9476
commit
ecdd71a43d
4 changed files with 112 additions and 176 deletions
|
@ -32,6 +32,7 @@ use tokio::task::block_in_place;
|
|||
use crate::error::ExitCode;
|
||||
use clients::wayland::{self, WaylandClient};
|
||||
use tracing::{debug, error, info};
|
||||
use universal_config::ConfigLoader;
|
||||
|
||||
const GTK_APP_ID: &str = "dev.jstanger.ironbar";
|
||||
const VERSION: &str = env!("CARGO_PKG_VERSION");
|
||||
|
@ -57,13 +58,19 @@ async fn main() -> Result<()> {
|
|||
|display| display,
|
||||
);
|
||||
|
||||
let config = match Config::load() {
|
||||
let config_res = match env::var("IRONBAR_CONFIG") {
|
||||
Ok(path) => ConfigLoader::load(path),
|
||||
Err(_) => ConfigLoader::new("ironbar").find_and_load(),
|
||||
};
|
||||
|
||||
let config = match config_res {
|
||||
Ok(config) => config,
|
||||
Err(err) => {
|
||||
error!("{:?}", err);
|
||||
exit(ExitCode::Config as i32)
|
||||
}
|
||||
};
|
||||
|
||||
debug!("Loaded config file");
|
||||
|
||||
if let Err(err) = create_bars(app, &display, wayland_client, &config) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue