|
@@ -43,6 +43,8 @@ case "$(uname)" in |
|
|
# remember if a display server is running since `ps` doesn't always contain a display |
|
|
# remember if a display server is running since `ps` doesn't always contain a display |
|
|
pgrepoutput="$(pgrep -ax X\(\|org\|wayland\))" |
|
|
pgrepoutput="$(pgrep -ax X\(\|org\|wayland\))" |
|
|
displays="$(echo "$pgrepoutput" | grep -wo "[0-9]*:[0-9]\+" | sort -u)" |
|
|
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 |
|
|
notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do |
|
|
export DISPLAY=$x |
|
|
export DISPLAY=$x |
|
|
notify-send --app-name="mutt-wizard" "New mail!" "📬 $2 new mail(s) in \`$1\` account." |
|
|
notify-send --app-name="mutt-wizard" "New mail!" "📬 $2 new mail(s) in \`$1\` account." |
|
|