SketchyBar/plugins/mailIndicator.sh

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