diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2022-05-12 13:10:47 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2022-05-12 13:10:47 -0700 |
commit | 5fdefd8ae9ec477b646b8852135f7a72f01fefb9 (patch) | |
tree | 3c7e1fbc09bcbeba0f07174a7b1aeb61fb58ca65 /bin/movemymail | |
parent | ea013b8c0d2baa13207be542e924ecae7c1c31fb (diff) | |
download | dotfiles-5fdefd8ae9ec477b646b8852135f7a72f01fefb9.tar.gz |
movemymail: execute notify-send(1) if mbsync fails
Diffstat (limited to 'bin/movemymail')
-rwxr-xr-x | bin/movemymail | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/movemymail b/bin/movemymail index 60919320..39f30eb6 100755 --- a/bin/movemymail +++ b/bin/movemymail @@ -37,7 +37,13 @@ system [0, 1], "offline"; $? >> 8 == 0 and die "we're offline; cannot further sync mail\n"; system "postqueue", "-f"; -system "mbsync", "fastmail"; +eval { system "mbsync", "fastmail" }; +if (my $exception = $@) { + local $ENV{XDG_RUNTIME_DIR} = "/run/user/$<"; + system "notify-send", "--urgency=critical", "--icon=dialog-warning", + "'mbsync fastmail' exited nonzero"; + die $exception; +} # athena's 'notmuch new' cronjob is responsible for imap-dl(1) runs. We have # this here rather than separate cronjob entries so that hitting 'G' in |