[MacTUG] Disabling the "notification center"

Donald Duff-McCracken dsmccrac at uwaterloo.ca
Tue Aug 23 11:25:34 EDT 2016


Greetings

I have previously disabled Notification Center (primarily so lab users will not be bugged about upgrades they cannot apply) by merely renaming the NotificationCenter.app in /System/Library/Core Services

In Yosemite this required dealing with SIP but it was doable. In El Capitan I tried it but it seriously messed up my deploystudio installs , when it was rebooting it would frequently hang and the logs would complain about Notification Center being MIA. When I stopped renaming Notification Center the problem went away.

At any rate I am looking for other ways to either kill the notification center, or enabling Do No Disturb. I found this on the JAMF forums https://jamfnation.jamfsoftware.com/discussion.html?id=13619 and ran manually it seems to work:

#!/bin/bash

# Gather the necessary variables
CURRENT_USER=$(/usr/bin/stat -f%Su /dev/console)
HARDWARE_UUID=$(system_profiler SPHardwareDataType | awk '/Hardware UUID: /{print $3}')
CURRENT_DATE=$(date -u +%FT%TZ)

# Modify the ByHost plist files
defaults -currentHost write "/Users/$CURRENT_USER/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturb -bool true
defaults -currentHost write "/Users/$CURRENT_USER/Library/Preferences/ByHost/com.apple.notificationcenterui" doNotDisturbDate -date "$CURRENT_DATE"

# Kill Notification Center for settings to take effect (it will automatically relaunch)
killall NotificationCenter

exit 0

I was considering making it a launch agent, but I thought I would see what other folks are doing with our friend the Notification Center in a lab situation.

Don


------------------------------------
Donald Duff-McCracken
Technical Services Manager
Mapping, Analysis & Design
Faculty of Environment
University of Waterloo
(519) 888-4567 x32151
https://uwaterloo.ca/environment-computing/about/people
------------------------------------
This email communication is intended as a private communication for the sole use of the primary addressee and those individuals listed for copies in the original message. The information contained in this email is private and confidential and If you are not an intended recipient you are hereby notified that copying, forwarding or other dissemination or distribution of this communication by any means is prohibited.  If you are not specifically authorized to receive this email and if you believe that you received it in error please notify the original sender immediately.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.uwaterloo.ca/pipermail/mactug/attachments/20160823/185738c2/attachment.html>


More information about the MacTUG mailing list