diff options
author | Luke Smith <luke@lukesmith.xyz> | 2023-01-15 08:30:40 -0500 |
---|---|---|
committer | Luke Smith <luke@lukesmith.xyz> | 2023-01-15 08:30:40 -0500 |
commit | 4773839af2b143190ddfc95db19d3fdbaeb958f4 (patch) | |
tree | 02f488461dfb82f63c18a4653ed9f587eeaab842 /bin | |
parent | 6b35770ca05fd303f2b97eafa7d31b68ed116f8e (diff) | |
parent | 38738b7ef4883e5a10382ffd5ef59507aa89a412 (diff) |
Merge branch 'master' of github.com:LukeSmithxyz/mutt-wizard
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/mailsync | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/mailsync b/bin/mailsync index 26e71ea..d2394f9 100755 --- a/bin/mailsync +++ b/bin/mailsync @@ -43,6 +43,8 @@ case "$(uname)" in # 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=$x notify-send --app-name="mutt-wizard" "New mail!" "📬 $2 new mail(s) in \`$1\` account." |