aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mbsync
diff options
context:
space:
mode:
Diffstat (limited to 'mbsync')
-rw-r--r--mbsync/.config/systemd/user/maildir-notify@.service3
-rwxr-xr-xmbsync/install.sh13
2 files changed, 9 insertions, 7 deletions
diff --git a/mbsync/.config/systemd/user/maildir-notify@.service b/mbsync/.config/systemd/user/maildir-notify@.service
index 6d2d3e0..3f1ada3 100644
--- a/mbsync/.config/systemd/user/maildir-notify@.service
+++ b/mbsync/.config/systemd/user/maildir-notify@.service
@@ -1,5 +1,6 @@
[Unit]
Description=Notify on new mail in MailDir %i
+PartOf=mbsync@%i.service
[Service]
Type=simple
@@ -7,4 +8,4 @@ ExecStart=%h/.local/bin/maildir-notify ${XDG_DATA_HOME}/mail/%i/INBOX
RestartSec=10
[Install]
-WantedBy=default.target
+WantedBy=mbsync@%i.service
diff --git a/mbsync/install.sh b/mbsync/install.sh
index de06c1a..957765e 100755
--- a/mbsync/install.sh
+++ b/mbsync/install.sh
@@ -1,13 +1,14 @@
#!/bin/sh
-if ! command -v "mbsync" >/dev/null; then
- printf "%s: mbsync not found, skipping...\n" "$0"
+pkgname=mbsync
+
+if ! command -v "$pkgname" >/dev/null; then
+ printf "%s: $pkgname not found, skipping...\n" "$0"
exit 0
fi
printf "%s: Installing services\n" "$0"
-systemctl --user enable --now --no-block mbsync@gmail.service
-systemctl --user enable --now --no-block mbsync@porkbun.service
-systemctl --user enable --now --no-block maildir-notify@gmail.service
-systemctl --user enable --now --no-block maildir-notify@porkbun.service
+for instance in gmail porkbun; do
+ systemctl --user enable --now --no-block $pkgname@"$instance".service
+done