#!/usr/bin/env bash # Waybar used a custom mail.py; here we read Mail.app's unread inbox count. # (First run may prompt for Automation permission. Swap this for your provider.) source "$HOME/.config/sketchybar/icons.sh" UNREAD="$(osascript -e 'tell application "Mail" to get unread count of inbox' 2>/dev/null)" if [ -n "$UNREAD" ] && [ "$UNREAD" -gt 0 ] 2>/dev/null; then sketchybar --set "$NAME" label="$MAIL $UNREAD" else sketchybar --set "$NAME" label="$MAIL" fi