This gist is to remind me (and anyone else who it helps) how to quickly disable and re-enable Notification Center.
-
Open your terminal (<⌘ + ␣ (spacebar)>, then type "terminal", then press <↩ (enter)>).
-
Paste and run the following command:
echo >> ~/.profile && echo >> ~/.profile && echo '# Disable/enable notification center' >> ~/.profile && echo 'alias disableNotificationCenter="launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist && killall NotificationCenter"' >> ~/.profile && echo 'alias enableNotificationCenter="launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist && open /System/Library/CoreServices/NotificationCenter.app/"' >> ~/.profile && source ~/.profile
To disable notification center:
disableNotificationCenter
To re-enable notification center:
enableNotificationCenter
Disable MacOS X's Notification Center entirely. But make it easy to turn it back on and disable again as needed.
I'm tired of seeing notifications that I can't dismiss, and there's no easy way to do this selectively (e.g. MacOS notifications always come through)
launchctl unload -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
killall NotificationCenter
launchctl load -w /System/Library/LaunchAgents/com.apple.notificationcenterui.plist
open /System/Library/CoreServices/NotificationCenter.app/
This approach is a command-line-only version of the solution proposed in a great article on osxdaily.com.
Even disabling SIP completely it will not make easy for macOS to be vulnerable. It will be as like as any UNIX, (which is very secure).. etc..
BUT..
Better yet, there is another way, with no worries or concerns at all:
.
You can Partially disable SIP, in such a way that it:
.
Thus giving a bit more of advanced control to you, by being able to start and stop services, without compromising the system (as it could if you had fully disabled SIP)
To do it, boot using COMMAND+R, once on the recovery mode, open Terminal and type:
csrutil enable --without fs
You will be fulling enabling SIP, without FS (File System option), but since the MacOS partition is ReadOnly, you continue 100% protected about any possible system file change, and it gives you the advanced control to Start and Stop Services, making able for you to execute the
lanchctl ..
command described on this thread, and making full use of it.I personally am using Catalina [latest 10.15.7 (19H1323)] with SIP configured this way. And I can assure you about the System Partition being fully read-only, and this option gives me the liberty that any advanced user [like me] wants or need sometimes]: to have a bit more control about the MacOS system.
..
After disabling and rebooting on normal mode, executing the SIP Status parameter, will show you this:
By doing it, you will have control to
to enable ou disable System Notification service, (or any other service via launchctl)
as described here on this topic.
.
(to revert, if you want to (e.g.) to fully re-enable SIP with ALL options, just type:
sudo csrutil clear
(can be done by sudo on MacOS Catalina without having to reboot on recovery, and for earlier versions:csrutil clear
typed on Terminal of recovery console. This command resets SIP to being fully enabled on factory settings.The beauty of MacOS is that we can customize it, and have any control we want over it, although sometimes is very hard to find out How to dig it :)