diff options
author | awy <awy@awy.one> | 2025-06-10 20:19:53 +0300 |
---|---|---|
committer | awy <awy@awy.one> | 2025-06-10 20:25:51 +0300 |
commit | 60588e772b45421037447218d477dbde140f5b46 (patch) | |
tree | 327d77fed5f288398f6b72f151f7f37664c2e851 | |
parent | b16c05c437209ed9f7e84c7a70dd7710642d2b80 (diff) |
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.
-rwxr-xr-x | bin/mailsync | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/bin/mailsync b/bin/mailsync index f25722e..43d76de 100755 --- 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 |