summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Christian Hesse <mail@eworm.de>2015-10-12 15:34:48 +0200
committerGravatar Christian Hesse <mail@eworm.de>2015-10-12 15:34:48 +0200
commita2df6c8866318959f6b97d6fbc0d36cc62e25b67 (patch)
treeb30a592a215f3e8e1ad22cb4ddf6566ebaa692b4
parent373de9ce488c437b91f38c3553a0cf3935c70861 (diff)
downloadudev-block-notify-a2df6c8866318959f6b97d6fbc0d36cc62e25b67.tar.gz
udev-block-notify-a2df6c8866318959f6b97d6fbc0d36cc62e25b67.tar.zst
use systemd user unit to (auto-)start
-rw-r--r--Makefile2
-rw-r--r--README.md8
-rw-r--r--systemd/udev-block-notify.service9
-rw-r--r--udev-block-notify.desktop8
4 files changed, 14 insertions, 13 deletions
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