xbar-plugins icon indicating copy to clipboard operation
xbar-plugins copied to clipboard

Version of DnD for Catalina

Open TheBox193 opened this issue 4 years ago • 1 comments

This has been customized a bit to fit my needs, and have no intention to take the time to make the script backwards compatible at this time. However it may serve as inspiration for someone as a proper patch to support newer OSs like Catalina. 🙂

The main change is the new method turning on / off Do Not Disturb by setting the value and restarting NotificationCenter. This might even work on older OSs depending.

Turn on:

defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean true
defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturbDate -date "`date -u +\"%Y-%m-%d %H:%M:%S +0000\"`"
killall NotificationCenter

Turn off:

defaults -currentHost write ~/Library/Preferences/ByHost/com.apple.notificationcenterui doNotDisturb -boolean false
killall NotificationCenter

TheBox193 avatar Sep 20 '20 05:09 TheBox193

@TheBox193

There are conflicts in your branch. Barring that, do see this turning into a non-draft PR?

sprak3000 avatar Jan 28 '23 02:01 sprak3000