mirror of
https://gitlab.com/apparmor/apparmor
synced 2025-09-02 07:15:18 +00:00
set DBUS_SESSION_BUS_ADDRESS, needed by notify-send
This is needed by new versions of notify-send, as found on openSUSE Tumbleweed. Without this, desktop notifications don't work anymore, and notify-send starts to eat up CPU. If DBUS_SESSION_BUS_ADDRESS is already set, it won't be changed.
This commit is contained in:
@@ -338,6 +338,9 @@ sub send_message {
|
|||||||
|
|
||||||
$notify_home ne "" and $ENV{'HOME'} = $notify_home;
|
$notify_home ne "" and $ENV{'HOME'} = $notify_home;
|
||||||
$notify_display ne "" and $ENV{'DISPLAY'} = $notify_display;
|
$notify_display ne "" and $ENV{'DISPLAY'} = $notify_display;
|
||||||
|
if (not defined($ENV{'DBUS_SESSION_BUS_ADDRESS'})) {
|
||||||
|
$ENV{'DBUS_SESSION_BUS_ADDRESS'} = "unix:path=/run/user/$>/bus";
|
||||||
|
}
|
||||||
|
|
||||||
# 'system' uses execvp() so no shell metacharacters here.
|
# 'system' uses execvp() so no shell metacharacters here.
|
||||||
# $notify_exe is an absolute path so execvp won't search PATH.
|
# $notify_exe is an absolute path so execvp won't search PATH.
|
||||||
|
Reference in New Issue
Block a user