aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 8a8096b6..9fe1394a 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -3,6 +3,7 @@ extern crate tracing;
mod animation;
mod backend;
+mod config_error_notification;
mod cursor;
#[cfg(feature = "dbus")]
mod dbus;
@@ -157,12 +158,14 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load the config.
let path = cli.config.or_else(default_config_path);
+ let mut config_errored = false;
let mut config = path
.as_deref()
.and_then(|path| match Config::load(path) {
Ok(config) => Some(config),
Err(err) => {
warn!("{err:?}");
+ config_errored = true;
None
}
})
@@ -239,6 +242,11 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
spawn(elem.command);
}
+ // Show the config error notification right away if needed.
+ if config_errored {
+ state.niri.config_error_notification.show();
+ }
+
// Run the compositor.
event_loop
.run(None, &mut state, |state| state.refresh_and_flush_clients())