aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-10-12 15:15:24 +0200
committerGravatar Christian Hesse <mail@eworm.de>2015-10-12 15:15:24 +0200
commit0a5677f9a10b31fa1a39861704c0fff4b6a15d66 (patch)
tree564523e153a6c5a8e9ff72a4810d51fef2f7c54a
parent5d91516de1d302fd8d589896b0635e828a201a06 (diff)
downloadmpd-notification-0a5677f9a10b31fa1a39861704c0fff4b6a15d66.tar.gz
mpd-notification-0a5677f9a10b31fa1a39861704c0fff4b6a15d66.tar.zst
use systemd user unit to (auto-)start
-rw-r--r--Makefile2
-rw-r--r--README.md8
-rw-r--r--mpd-notification.desktop8
-rw-r--r--systemd/mpd-notification.service9
4 files changed, 14 insertions, 13 deletions
diff --git a/Makefile b/Makefile
index 8e9bacb..f5716dd 100644
--- a/Makefile
+++ b/Makefile
@@ -36,7 +36,7 @@ install: install-bin install-doc
install-bin: mpd-notification
$(INSTALL) -D -m0755 mpd-notification $(DESTDIR)/usr/bin/mpd-notification
- $(INSTALL) -D -m0644 mpd-notification.desktop $(DESTDIR)/etc/xdg/autostart/mpd-notification.desktop
+ $(INSTALL) -D -m0644 systemd/mpd-notification.service $(DESTDIR)/usr/lib/systemd/user/mpd-notification.service
install-doc: README.html
$(INSTALL) -D -m0644 README.md $(DESTDIR)/usr/share/doc/mpd-notification/README.md
diff --git a/README.md b/README.md
index e3be1fb..08e021f 100644
--- a/README.md
+++ b/README.md
@@ -45,14 +45,14 @@ followed by:
This will place an executable at `/usr/bin/mpd-notification`,
documentation can be found in `/usr/share/doc/mpd-notification/`.
-Additionally a desktop file is installed to `/etc/xdg/autostart/`, this
-automatically starts the program when logged in to a desktop environment.
+Additionally a systemd unit file is installed to `/usr/lib/systemd/user/`.
Usage
-----
-Just run `mpd-notification` after installation or re-login to desktop
-environment for autostart.
+Just run `mpd-notification` to run it once. A systemd user service can be
+started and/or enabled with `systemctl --user start mpd-notification`
+or `systemctl --user enable mpd-notification`.
`mpd-notification` accepts some arguments:
diff --git a/mpd-notification.desktop b/mpd-notification.desktop
deleted file mode 100644
index 1dec877..0000000
--- a/mpd-notification.desktop
+++ /dev/null
@@ -1,8 +0,0 @@
-[Desktop Entry]
-Name=MPD Notification
-Icon=sound
-Exec=/usr/bin/mpd-notification
-Terminal=false
-Type=Application
-StartupNotify=false
-Categories=Utility
diff --git a/systemd/mpd-notification.service b/systemd/mpd-notification.service
new file mode 100644
index 0000000..e0dae1b
--- /dev/null
+++ b/systemd/mpd-notification.service
@@ -0,0 +1,9 @@
+[Unit]
+Description=MPD Notification
+
+[Service]
+Type=simple
+ExecStart=/usr/bin/mpd-notification
+
+[Install]
+WantedBy=default.target