|
@@ -42,7 +42,7 @@ case "$(uname)" in |
|
|
*systemd*|*openrc*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; |
|
|
*systemd*|*openrc*) export DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/$(id -u)/bus ;; |
|
|
esac |
|
|
esac |
|
|
# 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 -a 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)" |
|
|
notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do |
|
|
notify() { [ -n "$pgrepoutput" ] && for x in ${displays:-0:}; do |
|
|
export DISPLAY=$x |
|
|
export DISPLAY=$x |
|
|