Created
January 19, 2017 21:58
-
-
Save npazo/5496630475d7d6e7b644187e6e36d88d to your computer and use it in GitHub Desktop.
Get Count of Unread Notifications on macOS Sierra and set AnyBar
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
dir_loc=`getconf DARWIN_USER_DIR`/com.apple.notificationcenter/db | |
count=`sqlite3 $dir_loc/db 'select count(*) from presented_notifications'` | |
echo $count | |
if [ $count -ne 0 ]; then | |
/bin/echo -n "green" | nc -4u -w0 localhost 1739 | |
else | |
/bin/echo -n "white" | nc -4u -w0 localhost 1739 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment