浏览代码

Merge pull request #902 from KebabLord/master

read xorg displays from unix-domain socket if pgrep returns null
pull/906/head
Luke Smith 1年前
committed by GitHub
父节点
当前提交
38738b7ef4
找不到此签名对应的密钥 GPG 密钥 ID: 4AEE18F83AFDEB23
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. +2
    -0
      bin/mailsync

+ 2
- 0
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."


正在加载...
取消
保存