diff options
| author | Elvis Claros Castro <elvis@claros.ar> | 2026-09-26 19:26:33 -0300 |
|---|---|---|
| committer | Elvis Claros Castro <elvis@claros.ar> | 2026-09-26 19:26:33 -0300 |
| commit | d80640d01eeb84907e36ff4af33add9081eda17c (patch) | |
| tree | 27698b34e06e28d111c2196700015d9c82f78274 /systemd | |
| download | wa-cli-main.tar.gz wa-cli-main.zip | |
Diffstat (limited to 'systemd')
| -rw-r--r-- | systemd/wa-daemon@.service | 15 | ||||
| -rw-r--r-- | systemd/wamail-sync.service | 8 | ||||
| -rw-r--r-- | systemd/wamail-sync.timer | 11 |
3 files changed, 34 insertions, 0 deletions
diff --git a/systemd/wa-daemon@.service b/systemd/wa-daemon@.service new file mode 100644 index 0000000..4568ad0 --- /dev/null +++ b/systemd/wa-daemon@.service @@ -0,0 +1,15 @@ +[Unit] +Description=wa-cli: WhatsApp Web session (account %i) +After=network-online.target +Wants=network-online.target + +[Service] +Type=simple +ExecStart=%h/.local/bin/wa daemon start --foreground --account %i +# If WhatsApp Web disconnects or Chrome dies, the daemon exits with 1 and is restarted. +Restart=on-failure +RestartSec=15 +TimeoutStopSec=30 + +[Install] +WantedBy=default.target diff --git a/systemd/wamail-sync.service b/systemd/wamail-sync.service new file mode 100644 index 0000000..c8fb7a6 --- /dev/null +++ b/systemd/wamail-sync.service @@ -0,0 +1,8 @@ +[Unit] +Description=Sync WhatsApp (wa-cli) to a Maildir for neomutt +After=wa-daemon@default.service + +[Service] +Type=oneshot +ExecStart=%h/.local/bin/wamail sync +TimeoutStartSec=15min diff --git a/systemd/wamail-sync.timer b/systemd/wamail-sync.timer new file mode 100644 index 0000000..7ad1ce4 --- /dev/null +++ b/systemd/wamail-sync.timer @@ -0,0 +1,11 @@ +[Unit] +Description=Periodic WhatsApp (wamail) sync to a Maildir +# The daemon hook delivers in real time; the timer reconciles (read state, stars, deletions). + +[Timer] +OnBootSec=3min +OnUnitActiveSec=5min +RandomizedDelaySec=20 + +[Install] +WantedBy=timers.target |