1use std::path::Path;
2
3use calloop::EventLoop;
4use calloop_notify::NotifySource;
5use calloop_notify::notify::{RecursiveMode, Watcher};
6
7fn main() {
8 let mut event_loop = EventLoop::try_new().unwrap();
10 let loop_handle = event_loop.handle();
11
12 let mut notify_source = NotifySource::new().unwrap();
14 notify_source.watch(Path::new("."), RecursiveMode::Recursive).unwrap();
15
16 loop_handle
18 .insert_source(notify_source, |event, _, _| {
19 println!("Notify Event: {event:?}");
20 })
21 .unwrap();
22
23 loop {
25 event_loop.dispatch(None, &mut ()).unwrap();
26 }
27}