How can I disable notifications when the screen locks and enable them again when unlocking?
asked 2015-03-24 21:33:25 +0000
This post is a wiki. Anyone with karma >100 is welcome to improve it.
I use dunst for notifications and xautolock/i3lock for a lockscreen. I'd like to disable notifications when the screen locks by using 'killall -SIGUSER1 dunst' and re-enable notifications with 'killall -SIGUSER2 dunst' when the screen is unlocked. In my i3 config I use 'exec xautolock -time 10 -locker "i3lock"', so I could add the 'killall -SIGUSR1 dunst' to that line and disable notifications, but how would I automatically re-enable them when the screen gets unlocked?