From 2247f9f322a95b8fc44f0265e440b47992e06045 Mon Sep 17 00:00:00 2001 From: SqrtMinusOne Date: Thu, 13 Nov 2025 14:30:49 +0300 Subject: [PATCH] mail: add check-email to systemd timers --- .config/systemd/user/flameshot.service | 8 +++++++ .config/systemd/user/notmuch.service | 6 ++++++ .config/systemd/user/notmuch.timer | 9 ++++++++ Mail.org | 29 +++++++++++++++++++++++--- 4 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 .config/systemd/user/flameshot.service create mode 100644 .config/systemd/user/notmuch.service create mode 100644 .config/systemd/user/notmuch.timer diff --git a/.config/systemd/user/flameshot.service b/.config/systemd/user/flameshot.service new file mode 100644 index 0000000..27a39a9 --- /dev/null +++ b/.config/systemd/user/flameshot.service @@ -0,0 +1,8 @@ +[Unit] +Description=Flameshot + +[Service] +ExecStart=/usr/bin/flameshot + +[Install] +WantedBy=wm-session.target diff --git a/.config/systemd/user/notmuch.service b/.config/systemd/user/notmuch.service new file mode 100644 index 0000000..6b5e210 --- /dev/null +++ b/.config/systemd/user/notmuch.service @@ -0,0 +1,6 @@ +[Unit] +Description=Update notmuch mail index + +[Service] +Type=oneshot +ExecStart=/usr/bin/bash /home/pavel/bin/scripts/check-email diff --git a/.config/systemd/user/notmuch.timer b/.config/systemd/user/notmuch.timer new file mode 100644 index 0000000..84dff16 --- /dev/null +++ b/.config/systemd/user/notmuch.timer @@ -0,0 +1,9 @@ +[Unit] +Description=Run notmuch new every 5 minutes + +[Timer] +OnBootSec=1min +OnUnitActiveSec=5min + +[Install] +WantedBy=timers.target diff --git a/Mail.org b/Mail.org index 75d1204..7d735d2 100644 --- a/Mail.org +++ b/Mail.org @@ -358,10 +358,33 @@ fi echo "$(date +%s)" > $CHECK_FILE #+end_src -The script is ran via GNU Mcron every 5 minutes. -#+begin_src scheme :tangle ~/.config/cron/mail.guile -(job "*/5 * * * * " "~/bin/scripts/check-email") +The script is ran via systemd every 5 minutes. +#+begin_src conf :tangle .config/systemd/user/notmuch.service +[Unit] +Description=Update notmuch mail index + +[Service] +Type=oneshot +ExecStart=/usr/bin/bash /home/pavel/bin/scripts/check-email #+end_src + +#+begin_src conf :tangle .config/systemd/user/notmuch.timer +[Unit] +Description=Run notmuch sync script every 5 minutes + +[Timer] +OnBootSec=1min +OnUnitActiveSec=5min + +[Install] +WantedBy=timers.target +#+end_src + +Don't forget to run: +#+begin_src bash +systemctl --user enable --now notmuch.timer +#+end_src + * MSMTP | Arch dependency | |-----------------|