SketchyBar/plugins/mailIndicator.sh

12 lines
301 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 $NAME label "$COUNT"
2021-08-09 17:06:10 +00:00
else
sketchybar -m set $NAME label 
2021-08-09 17:06:10 +00:00
fi