Fix desktop notification not shown when DBUS_SESSION_BUS_ADDRESS environment variable is not set
This commit is contained in:
parent
18a2cc2774
commit
e68fed9277
|
@ -251,7 +251,9 @@ desktop_notify() {
|
||||||
esac
|
esac
|
||||||
|
|
||||||
if [[ "$user" != "" ]]; then
|
if [[ "$user" != "" ]]; then
|
||||||
sudo -u "$user" DISPLAY=":0.0" notify-send -i "$icon" -u "$urgency" "rs-backup: $2" "$3"
|
dbus_pid=$(pgrep -u "$user" dbus-daemon | head -n1)
|
||||||
|
environment=$(xargs --null < /proc/$dbus_pid/environ)
|
||||||
|
sudo -u "$user" $environment notify-send -i "$icon" -u "$urgency" "rs-backup: $2" "$3"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue