SketchyBar/plugins/mailIndicator.sh

12 lines
305 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')
2021-10-21 22:27:28 +00:00
sketchybar -m --set $NAME label="$COUNT"
2021-08-09 17:06:10 +00:00
else
2021-10-21 22:27:28 +00:00
sketchybar -m --set $NAME label=
2021-08-09 17:06:10 +00:00
fi