SketchyBar/plugins/mailIndicator.sh

12 lines
317 B
Bash
Raw Normal View History

2021-08-09 17:06:10 +00:00
#!/usr/bin/env bash
RUNNING=$(osascript -e 'if application "Mail" is running then return 0')
COUNT=0
if [ $RUNNING == 0 ]; then
2021-08-13 13:58:00 +00:00
COUNT=$(osascript -e 'tell application "Mail" to return the unread count of inbox')
sketchybar -m set mailIndicator label "$COUNT"
2021-08-09 17:06:10 +00:00
else
2021-08-13 13:58:00 +00:00
sketchybar -m set mailIndicator label 
2021-08-09 17:06:10 +00:00
fi