Closed BR00l closed 3 years ago
You can just implement this as a user plugin. The script for simple global inbox count:
osascript -l JavaScript -e '(x => {x.checkForNewMail();return x.inbox().unreadCount()})(Application("Mail"))'
My personal script (unread count over all mailboxes except my gmail accounts archive ('All Mail') to avoid duplicates):
osascript -l JavaScript -e '(x => {x.checkForNewMail();return x.accounts().flatMap(a => a.mailboxes()).filter(a => a.name() !== "All Mail").map(a => a.unreadCount()).reduce((a,b) => a+b, 0)})(Application("Mail"))'
To open Mail on clicking the widget use
osascript -l JavaScript -e '(x => x.activate() && x.messageViewers().length == 0 && x.MessageViewer().make())(Application("Mail"))'
I think this indeed should be handled with the custom user widgets system as everyone has a different email setup!
Hello there, you have done an asthonishing work here, I really like the whole setup and the idea of this bar! I have one request though, Is there a possibility for a mail indicator plugin on the bar?