From: Maximilian Friedersdorff Date: Fri, 13 May 2016 14:21:35 +0000 (+0100) Subject: Script for launching mutt while running mbsync X-Git-Url: https://git.friedersdorff.com/?a=commitdiff_plain;h=c99591cabbd432a711c47dfdc07bf5b8603133e3;p=max%2Fdotfiles.git Script for launching mutt while running mbsync --- diff --git a/offline_mail/.mutt/mutt_with_mbsync.sh b/offline_mail/.mutt/mutt_with_mbsync.sh new file mode 100755 index 0000000..d243110 --- /dev/null +++ b/offline_mail/.mutt/mutt_with_mbsync.sh @@ -0,0 +1,31 @@ +#!/bin/sh + +PID="/var/run/user/1000/sync_maiboxes.pid" + +clean_up() +{ + kill -TERM $(cat $PID) + rm $PID + exit +} + +trap clean_up SIGTERM SIGHUP SIGINT + +sync_maiboxes() +{ + while true + do + /usr/bin/mbsync -c /home/max/.mbsync/personal.mbsync -aq + /usr/bin/mbsync -c /home/max/.mbsync/personal-gmail.mbsync -aq + /usr/bin/mbsync -c /home/max/.mbsync/student.mbsync -aq + /usr/bin/mbsync -c /home/max/.mbsync/musoft.mbsync -aq + + sleep 250 + done +} + +sync_maiboxes& +echo $! > $PID +/usr/bin/mutt + +clean_up