diff options
Diffstat (limited to 'src/utils/watcher.rs')
| -rw-r--r-- | src/utils/watcher.rs | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/utils/watcher.rs b/src/utils/watcher.rs index 4ed4c8ae..034e963a 100644 --- a/src/utils/watcher.rs +++ b/src/utils/watcher.rs @@ -5,7 +5,7 @@ use std::sync::mpsc; use std::time::{Duration, SystemTime}; use std::{io, thread}; -use niri_config::ConfigPath; +use niri_config::{Config, ConfigPath}; use smithay::reexports::calloop::channel::SyncSender; use crate::niri::State; @@ -137,10 +137,17 @@ pub fn setup(state: &mut State, config_path: &ConfigPath) { state .niri .event_loop - .insert_source(rx, |event, _, state| match event { - calloop::channel::Event::Msg(config) => state.reload_config(config), - calloop::channel::Event::Closed => (), - }) + .insert_source( + rx, + |event: calloop::channel::Event<Result<Config, ()>>, _, state| match event { + calloop::channel::Event::Msg(config) => { + let failed = config.is_err(); + state.reload_config(config); + state.ipc_config_loaded(failed); + } + calloop::channel::Event::Closed => (), + }, + ) .unwrap(); state.niri.config_file_watcher = Some(Watcher::new(config_path.clone(), process, tx)); |
