From a2df6c8866318959f6b97d6fbc0d36cc62e25b67 Mon Sep 17 00:00:00 2001 From: Christian Hesse Date: Mon, 12 Oct 2015 15:34:48 +0200 Subject: use systemd user unit to (auto-)start --- Makefile | 2 +- README.md | 8 ++++---- systemd/udev-block-notify.service | 9 +++++++++ udev-block-notify.desktop | 8 -------- 4 files changed, 14 insertions(+), 13 deletions(-) create mode 100644 systemd/udev-block-notify.service delete mode 100644 udev-block-notify.desktop diff --git a/Makefile b/Makefile index eb8dcbd..15dd88d 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ install: install-bin install-doc install-bin: udev-block-notify $(INSTALL) -D -m0755 udev-block-notify $(DESTDIR)/usr/bin/udev-block-notify - $(INSTALL) -D -m0644 udev-block-notify.desktop $(DESTDIR)/etc/xdg/autostart/udev-block-notify.desktop + $(INSTALL) -D -m0644 systemd/udev-block-notify.service $(DESTDIR)/usr/lib/systemd/user/udev-block-notify.service install-doc: README.html $(INSTALL) -D -m0644 README.md $(DESTDIR)/usr/share/doc/udev-block-notify/README.md diff --git a/README.md b/README.md index 486647e..c113dad 100644 --- a/README.md +++ b/README.md @@ -40,14 +40,14 @@ followed by: This will place an executable at `/usr/bin/udev-block-notify`, documentation can be found in `/usr/share/doc/udev-block-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 `udev-block-notify` after installation or re-login to desktop -environment for autostart. +Just run `udev-block-notify` to run it once. A systemd user service can be +started and/or enabled with `systemctl --user start udev-block-notify` +or `systemctl --user enable udev-block-notify`. ### Upstream diff --git a/systemd/udev-block-notify.service b/systemd/udev-block-notify.service new file mode 100644 index 0000000..375fc63 --- /dev/null +++ b/systemd/udev-block-notify.service @@ -0,0 +1,9 @@ +[Unit] +Description=Udev Block Notification + +[Service] +Type=simple +ExecStart=/usr/bin/udev-block-notify + +[Install] +WantedBy=default.target diff --git a/udev-block-notify.desktop b/udev-block-notify.desktop deleted file mode 100644 index 58521bd..0000000 --- a/udev-block-notify.desktop +++ /dev/null @@ -1,8 +0,0 @@ -[Desktop Entry] -Name=Udev Block Notify -Icon=media-removable -Exec=/usr/bin/udev-block-notify -Terminal=false -Type=Application -StartupNotify=false -Categories=Utility -- cgit v1.2.3-54-g00ecf