From 69c8a3a0546d16b9c965641a76f8fc2499e8de0b Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 12 Oct 2015 14:50:12 +0200 Subject: use systemd user unit to (auto-)start --- Makefile | 2 +- README.md | 8 ++++---- netlink-notify.desktop | 8 -------- systemd/netlink-notify.service | 9 +++++++++ 4 files changed, 14 insertions(+), 13 deletions(-) delete mode 100644 netlink-notify.desktop create mode 100644 systemd/netlink-notify.service diff --git a/Makefile b/Makefile index 6da3ce7..a273d23 100644 --- a/Makefile +++ b/Makefile @@ -46,7 +46,7 @@ install: install-bin install-doc install-bin: netlink-notify icons $(INSTALL) -D -m0755 netlink-notify $(DESTDIR)/usr/bin/netlink-notify - $(INSTALL) -D -m0644 netlink-notify.desktop $(DESTDIR)/etc/xdg/autostart/netlink-notify.desktop + $(INSTALL) -D -m0644 systemd/netlink-notify.service $(DESTDIR)/usr/lib/systemd/user/netlink-notify.service $(INSTALL) -D -m0755 icons/netlink-notify-up.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/status/netlink-notify-up.svg $(INSTALL) -D -m0755 icons/netlink-notify-down.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/status/netlink-notify-down.svg $(INSTALL) -D -m0755 icons/netlink-notify-address.svg $(DESTDIR)/usr/share/icons/hicolor/scalable/status/netlink-notify-address.svg diff --git a/README.md b/README.md index 9dbb89c..de6dd4f 100644 --- a/README.md +++ b/README.md @@ -52,14 +52,14 @@ followed by: This will place an executable at `/usr/bin/netlink-notify`, documentation can be found in `/usr/share/doc/netlink-notify/`. -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 `netlink-notify` after installation or re-login to desktop -environment for autostart. +Just run `netlink-notify` to run it once. A systemd user service can be +started and/or enabled with `systemctl --user start netlink-notify` +or `systemctl --user enable netlink-notify`. ### Upstream diff --git a/netlink-notify.desktop b/netlink-notify.desktop deleted file mode 100644 index 6b8e10b..0000000 --- a/netlink-notify.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=Netlink Notify -Icon=network-transmit-receive -Exec=/usr/bin/netlink-notify -Terminal=false -Type=Application -StartupNotify=false -Categories=Utility diff --git a/systemd/netlink-notify.service b/systemd/netlink-notify.service new file mode 100644 index 0000000..2db23c7 --- /dev/null +++ b/systemd/netlink-notify.service @@ -0,0 +1,9 @@ +[Unit] +Description=Netlink Notification + +[Service] +Type=simple +ExecStart=/usr/bin/netlink-notify + +[Install] +WantedBy=default.target -- cgit v1.2.3-54-g00ecf