]> git.rmz.io Git - dotfiles.git/blobdiff - systemd/user/checkupdates.service
systemd: add user unit to download packages automatically
[dotfiles.git] / systemd / user / checkupdates.service
diff --git a/systemd/user/checkupdates.service b/systemd/user/checkupdates.service
new file mode 100644 (file)
index 0000000..d3788df
--- /dev/null
@@ -0,0 +1,13 @@
+# Requires following line in sudoers allowing users in wheel 
+# to download packages without password
+# %wheel ALL=(ALL) NOPASSWD: /usr/bin/pacman -Sw --noconfirm * --dbpath *
+
+[Unit]
+Description=Check pacman updates and dowload packages to cache
+After=network-online.target
+
+[Service]
+Type=oneshot
+ExecStart=/usr/bin/checkupdates -d
+# checkupdates returns 2 when there are no updates
+SuccessExitStatus=2