From db449a969b72f1f8ee36cf6eead7885447fe96ea Mon Sep 17 00:00:00 2001 From: hyzen Date: Tue, 10 Feb 2026 12:23:09 +0530 Subject: [PATCH] Add: wrapper script to run mbsync everytime mutt is started --- mutt-add-account.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mutt-add-account.sh b/mutt-add-account.sh index 6e4a66a..90af70d 100755 --- a/mutt-add-account.sh +++ b/mutt-add-account.sh @@ -791,6 +791,24 @@ fi mv "${mutt_config}.tmp" "$mutt_config" +# ------------------------------------------------------- +# Create/update neomutt wrapper script +# ------------------------------------------------------- +wrapper_script="$HOME/.local/bin/neomutt" +mkdir -p "$HOME/.local/bin" + +# Collect all configured email addresses from mbsyncrc channels +# Each "Channel " line in .mbsyncrc is one account to sync +cat > "$wrapper_script" << 'WRAPPER_EOF' +#!/bin/bash +mbsync -q -a & +exec /usr/bin/neomutt +WRAPPER_EOF + +chmod +x "$wrapper_script" +echo "Created wrapper script: $wrapper_script" +echo "(make sure ~/.local/bin is in your PATH)" + echo echo "=== Setup Complete ===" echo "Account: $email"