Skip to content

Instantly share code, notes, and snippets.

@LucaTNT
Forked from giu1io/cleanNotifications.sh
Last active August 29, 2015 14:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save LucaTNT/9365e496f8c3f045b4f3 to your computer and use it in GitHub Desktop.
Save LucaTNT/9365e496f8c3f045b4f3 to your computer and use it in GitHub Desktop.
Cleans OS X's Notification Center
#!/bin/bash
# Author: @giu1io
# 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