aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xmail-overview/mail-notify.sh11
1 files changed, 9 insertions, 2 deletions
diff --git a/mail-overview/mail-notify.sh b/mail-overview/mail-notify.sh
index fc75c56..e6c9868 100755
--- a/mail-overview/mail-notify.sh
+++ b/mail-overview/mail-notify.sh
@@ -37,6 +37,13 @@ SCOPE='tag:unread and tag:inbox'
# Three matches the drawer's own --limit=3.
ROWS=3
+# dunst here resolves a themed icon NAME only through its icon_path, which
+# holds no mail icon, so a name renders nothing (dunst stores an empty
+# icon_path for it). Pass an absolute path, as this machine's other
+# notifiers do. This is the icon the user picked; ${XDG_DATA_HOME} keeps a
+# home path out of the committed file.
+MAIL_ICON="${XDG_DATA_HOME:-$HOME/.local/share}/icons/MB-Blueberry-Suru-GLOW/actions/24/mail-unread-multiple.svg"
+
# Accounts in file order, one "key<TAB>label" line each, read from stdin.
#
# Two things here are load-bearing, and both have already broken this
@@ -170,7 +177,7 @@ notify_account() {
if ! command -v dunstify >/dev/null 2>&1; then
# No actions available, but a notification without a click is still
# worth having.
- notify-send -a "New Mail" -u normal -t 10000 -i mail-unread-multiple \
+ notify-send -a "New Mail" -u normal -t 10000 -i "$MAIL_ICON" \
"$label ($count)" "$body"
return 0
fi
@@ -179,7 +186,7 @@ notify_account() {
# clicked. Without this the loop would stall for the full timeout on
# every account, and a five-account batch would take most of a minute.
(
- if [[ "$(dunstify -a "New Mail" -i mail-unread-multiple -u normal -t 10000 -b \
+ if [[ "$(dunstify -a "New Mail" -i "$MAIL_ICON" -u normal -t 10000 -b \
-h "string:x-dunst-stack-tag:mail-$key" \
-A "default,open" \
"$label ($count)" "$body")" == "default" ]]; then