From 52b08e4f19e6e2cf4b334f021505cba2244953ae Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Wed, 10 May 2017 12:50:11 -0300 Subject: [PATCH 1/3] Don't hardcode a DISPLAY variable Hardcoding a DISPLAY variable is a bad idea because it means that dunst will only run on X11, and only for that specific configuration. FWIW, this actually applies to any desktop app run via systemd: 1. `DISPLAY` should be set by `systemctl --user set-environment` elsewhere. 2. `DISPLAY=:0` is not universally valid. 3. This breaks dunst if attempting to run wayland, and requires manually starting it (eg: not via systemd), or editing the file. --- contrib/dunst.systemd.service.in | 1 - 1 file changed, 1 deletion(-) diff --git a/contrib/dunst.systemd.service.in b/contrib/dunst.systemd.service.in index 61ca237..54aec39 100644 --- a/contrib/dunst.systemd.service.in +++ b/contrib/dunst.systemd.service.in @@ -6,7 +6,6 @@ Documentation=man:dunst(1) Type=dbus BusName=org.freedesktop.Notifications ExecStart=##PREFIX##/bin/dunst -Environment=DISPLAY=:0 [Install] WantedBy=default.target From 7c967879e22095e5a460781a840d73c6fa9181aa Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 18 May 2017 15:30:24 -0300 Subject: [PATCH 2/3] Make dunst.service part of graphical-session Make dunst part of graphical-session.target, so that it exits immediately when the session exits. --- contrib/dunst.systemd.service.in | 1 + 1 file changed, 1 insertion(+) diff --git a/contrib/dunst.systemd.service.in b/contrib/dunst.systemd.service.in index 54aec39..11df700 100644 --- a/contrib/dunst.systemd.service.in +++ b/contrib/dunst.systemd.service.in @@ -1,6 +1,7 @@ [Unit] Description=Dunst notification daemon Documentation=man:dunst(1) +PartOf=graphical-session.target [Service] Type=dbus From 94da3eecc5c1ba31e174ddbedd725bc7f55fe592 Mon Sep 17 00:00:00 2001 From: Hugo Osvaldo Barrera Date: Thu, 18 May 2017 15:34:53 -0300 Subject: [PATCH 3/3] Install the systemd user service file by default --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index 01c0662..ac2843c 100644 --- a/Makefile +++ b/Makefile @@ -64,6 +64,7 @@ install-doc: install-service: service mkdir -p ${DESTDIR}${PREFIX}/share/dbus-1/services/ install -m644 org.knopwob.dunst.service ${DESTDIR}${PREFIX}/share/dbus-1/services + install -Dm644 dunst.systemd.service ${DESTDIR}${PREFIX}/lib/systemd/user/dunst.service install: install-dunst install-doc install-service