aboutsummaryrefslogtreecommitdiff
path: root/users/ryan/modules/sketchybar/bar-config/plugins/mail.sh
diff options
context:
space:
mode:
authorRyan Schanzenbacher <ryan@rschanz.org>2026-07-11 22:14:43 -0400
committerRyan Schanzenbacher <ryan@rschanz.org>2026-07-11 22:14:43 -0400
commitd2b62c9d6f30a0ea88b2a235cde120cd10ba332b (patch)
treef373003e64c3ec4593d7ae4ffac72de52767aa70 /users/ryan/modules/sketchybar/bar-config/plugins/mail.sh
parent27117202739f092d837af2752e4b9801c47b8ddb (diff)
Sketchybar now, got tired of the battery issue
Diffstat (limited to 'users/ryan/modules/sketchybar/bar-config/plugins/mail.sh')
-rwxr-xr-xusers/ryan/modules/sketchybar/bar-config/plugins/mail.sh12
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.)
4source "$HOME/.config/sketchybar/icons.sh"
5
6UNREAD="$(osascript -e 'tell application "Mail" to get unread count of inbox' 2>/dev/null)"
7
8if [ -n "$UNREAD" ] && [ "$UNREAD" -gt 0 ] 2>/dev/null; then
9 sketchybar --set "$NAME" label="$MAIL $UNREAD"
10else
11 sketchybar --set "$NAME" label="$MAIL"
12fi