-
Notifications
You must be signed in to change notification settings - Fork 494
Open
Description
Thanks for i3status-rust!
I have a custom block to notify me of new messages. It watches the file /var/mail/mylogin and runs a custom script. The custom script outputs the number of messages formatted for i3status-rust and plays a sound. The problem is: the sound plays four times.
To fix the issue, I made this change:
diff --git a/src/blocks/custom.rs b/src/blocks/custom.rs
index 234127091..861d8695b 100644
--- a/src/blocks/custom.rs
+++ b/src/blocks/custom.rs
@@ -173,13 +173,7 @@ pub async fn run(config: &Config, api: &CommonApi) -> Result<()> {
for file in files {
let file = file.expand()?;
watches
- .add(
- &*file,
- WatchMask::MODIFY
- | WatchMask::CLOSE_WRITE
- | WatchMask::DELETE
- | WatchMask::MOVE,
- )
+ .add(&*file, WatchMask::CLOSE_WRITE)
.error("Failed to add file watch")?;
}
Box::pin(I didn't make a pull request because other people may want the four events or choose one different from CLOSE_WRITE.
Metadata
Metadata
Assignees
Labels
No labels