jacobsalmela / NCutil

Notification Center utility- Add/remove apps, set alert styles, suppress App store notifications
GNU General Public License v2.0
171 stars 18 forks source link

NCutil doesn't always choose the correct db #4

Closed gregneagle closed 9 years ago

gregneagle commented 9 years ago

Currently NCutil does a glob agains the db directory and uses the first result of that glob. But here's the dir on my machine:

gneagle@mba:NotificationCenter % ls -aln
total 1256
drwxrwxr-x   5 4389  100     170 Mar 31 11:21 .
drwx------  99 4389  100    3366 Mar 20 13:06 ..
-rw-r--r--   1 4389  100  249856 Jul 31  2013 3002695A-B629-45BD-99A2-FBCF1C5ACA48.db
-rw-r--r--   1 4389  100  233472 Mar 31 11:21 826FC8A7-6AB4-4D1C-9D55-646E8FCD77CD.db
-rw-r--r--   1 4389  100  159744 Nov  6  2012 C2AAE2EA-95CA-4408-991E-5D894CE5A869.db

Note it is the second db that is currently in use, and so the current code in NCutil picks the wrong one.

I'l try to have a PR later today that is smarter about selecting the right db. I wish we knew what "826FC8A7-6AB4-4D1C-9D55-646E8FCD77CD" was -- my first thought was it was the Hardware UUID for the machine, but that's not the case. If we can't figure that out, we'll have to go with "most recently modified".

jacobsalmela commented 9 years ago

Yeah, I struggled for a long time trying to figure out what the number came from but ended up with nothing.

jacobsalmela commented 9 years ago

fixed with #5