Fix desktop notification not shown when DBUS_SESSION_BUS_ADDRESS environment variable is not set
parent
18a2cc2774
commit
e68fed9277
|
@ -251,7 +251,9 @@ desktop_notify() {
|
|||
esac
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue