mutt-wizard

fork of Luke Smith's mutt-wizard
Log | Files | Refs | README | LICENSE

commit 60588e772b45421037447218d477dbde140f5b46
parent b16c05c437209ed9f7e84c7a70dd7710642d2b80
Author: awy <awy@awy.one>
Date:   Tue, 10 Jun 2025 20:19:53 +0300

notifications fix on wayland.
this script was checking for a running xwayland process to find
available displays, however in some cases no xwayland process may be
running. therefore you got no notifications.

Diffstat:
Mbin/mailsync | 9++-------
1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/bin/mailsync b/bin/mailsync @@ -42,15 +42,10 @@ case "$(uname)" in *systemd*|*openrc*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; *dinit*) export DBUS_SESSION_BUS_ADDRESS=$(grep -E -z "DBUS_SESSION_BUS_ADDRESS" "/proc/$(pgrep -x swaybar)/environ" | sed 's/DBUS_SESSION_BUS_ADDRESS=//') ;; esac - # remember if a display server is running since `ps` doesn't always contain a display - pgrepoutput="$(pgrep -ax X\(\|org\|wayland\))" - displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)" - [ -z "$displays" ] && [ -d /tmp/.X11-unix ] && displays=$(cd /tmp/.X11-unix && for x in X*; do echo ":${x#X}"; done) - notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-:0}; do - export DISPLAY=":0" + notify() { notify-send --app-name="mutt-wizard" -- "$1" "$2" - done ;} + } ;; esac