diff options
Diffstat (limited to 'modules/communication/neomutt/neomutt-launcher.sh')
| -rw-r--r-- | modules/communication/neomutt/neomutt-launcher.sh | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/modules/communication/neomutt/neomutt-launcher.sh b/modules/communication/neomutt/neomutt-launcher.sh new file mode 100644 index 0000000..d677680 --- /dev/null +++ b/modules/communication/neomutt/neomutt-launcher.sh @@ -0,0 +1,16 @@ +#!/usr/bin/env bash +# Wrapped neomutt: keeps the neomutt-sync systemd daemon alive for the +# lifetime of a neomutt session. +set -uo pipefail +SYSTEMCTL='@@SYSTEMCTL@@' +PGREP='@@PGREP@@' +NEOMUTT='@@NEOMUTT@@' + +"$SYSTEMCTL" --user start neomutt-sync.service || true +stop_service() { + "$PGREP" -x neomutt >/dev/null || "$SYSTEMCTL" --user stop neomutt-sync.service || true +} +trap stop_service EXIT + +export PATH="@@PROFILE_BIN@@:@@URLSCAN_BIN@@:$PATH" +"$NEOMUTT" "$@" |
