diff options
| author | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-08-03 01:22:44 -0400 |
|---|---|---|
| committer | Ryan Schanzenbacher <ryan@rschanz.org> | 2026-08-03 01:22:44 -0400 |
| commit | 0c8fa3a2a270747f3dbb54fe8792f3f0aec997e3 (patch) | |
| tree | 6f94ff3aeea2af859c7c166e01a8e73002017893 /users/ryan/modules/sketchybar/bar-config/plugins/mail.sh | |
Initial commit: combined darwin + guix-linux home-manager flake
Supersedes nix-dotfiles (darwin) and guix-dotfiles' ad-hoc
nix-home-manager flake (linux). See README.md/MIGRATION.md.
Diffstat (limited to 'users/ryan/modules/sketchybar/bar-config/plugins/mail.sh')
| -rwxr-xr-x | users/ryan/modules/sketchybar/bar-config/plugins/mail.sh | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/users/ryan/modules/sketchybar/bar-config/plugins/mail.sh b/users/ryan/modules/sketchybar/bar-config/plugins/mail.sh new file mode 100755 index 0000000..7ce2fe6 --- /dev/null +++ b/users/ryan/modules/sketchybar/bar-config/plugins/mail.sh | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | #!/usr/bin/env bash | ||
| 2 | # Waybar used a custom mail.py; here we read Mail.app's unread inbox count. | ||
| 3 | # (First run may prompt for Automation permission. Swap this for your provider.) | ||
| 4 | source "$HOME/.config/sketchybar/icons.sh" | ||
| 5 | |||
| 6 | UNREAD="$(osascript -e 'tell application "Mail" to get unread count of inbox' 2>/dev/null)" | ||
| 7 | |||
| 8 | if [ -n "$UNREAD" ] && [ "$UNREAD" -gt 0 ] 2>/dev/null; then | ||
| 9 | sketchybar --set "$NAME" label="$MAIL $UNREAD" | ||
| 10 | else | ||
| 11 | sketchybar --set "$NAME" label="$MAIL" | ||
| 12 | fi | ||
