(Scripts|SystemD)+mail fetch script and a SystemDservice/timer for it
Syncs every 3 hours. Produces a notify-send message on fetching.
This commit is contained in:
6
Scripts/.local/scripts/mail_fetch
Executable file
6
Scripts/.local/scripts/mail_fetch
Executable file
@@ -0,0 +1,6 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
|
||||||
|
prev=$(notmuch count)
|
||||||
|
mbsync -a
|
||||||
|
new=$(notmuch count)
|
||||||
|
notify-send "mail_fetch: Fetched $(echo $new - $prev | bc -l) mail"
|
||||||
6
SystemD/.config/systemd/user/mail.service
Normal file
6
SystemD/.config/systemd/user/mail.service
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Syncing mail using mbsyncrc
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=simple
|
||||||
|
ExecStart=%h/.local/scripts/mail_fetch
|
||||||
10
SystemD/.config/systemd/user/mail.timer
Normal file
10
SystemD/.config/systemd/user/mail.timer
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Run mail sync every 3 hours
|
||||||
|
|
||||||
|
[Timer]
|
||||||
|
OnBootSec=1min
|
||||||
|
OnUnitActiveSec=10800
|
||||||
|
Unit=mail.service
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=timers.target
|
||||||
Reference in New Issue
Block a user