Last active
August 29, 2015 14:21
-
-
Save giu1io/3be17b5c5cb9b043774f to your computer and use it in GitHub Desktop.
Shell script that removes all notifications from Notification Center on OSX
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Thanks @LucaTNT for making the script work on < 10.10 | |
MAJOR_OSX_VERSION=$(sw_vers -productVersion | awk -F '.' '{print $2}') | |
if [[ $MAJOR_OSX_VERSION -ge 10 ]] | |
then | |
DB_PATH=`getconf DARWIN_USER_DIR`com.apple.notificationcenter/db/db | |
else | |
DB_PATH="$HOME/Library/Application Support/NotificationCenter/" | |
DB_PATH=$DB_PATH`ls "$DB_PATH"` | |
fi | |
sqlite3 "$DB_PATH" "DELETE FROM notifications WHERE 1" | |
killall usernoted | |
killall NotificationCenter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment