diff options
| author | Robert Günzler <r@gnzler.io> | 2022-12-15 21:16:35 +0100 |
|---|---|---|
| committer | Robert Günzler <r@gnzler.io> | 2022-12-15 21:16:35 +0100 |
| commit | b15fe235cca01f678940acaaa31433f02ed85b31 (patch) | |
| tree | be761ec0cc6665ace41f838b0ac3f2384d908a4b /bin/hibiki | |
| parent | af2cfcc1ecd4a6d224976515a8b51f22342da61b (diff) | |
mailsync: check for tool dependencies
Signed-off-by: Robert Günzler <r@gnzler.io>
Diffstat (limited to 'bin/hibiki')
| -rwxr-xr-x | bin/hibiki/mailsync | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/bin/hibiki/mailsync b/bin/hibiki/mailsync index bea6e83..2009474 100755 --- a/bin/hibiki/mailsync +++ b/bin/hibiki/mailsync @@ -3,6 +3,14 @@ set -e [ -n "$DEBUG" ] && set -x +# check requirements +for tool in mbsync notify-send python awk gdbus iconez; do + if ! command -v "$tool" >/dev/null; then + printf '%s: %s not installed but required\n' "$(basename "$0")" "$tool" >&2 + exit 1 + fi +done + maildir="${HOME}/mail" cachefile=${XDG_CACHE_HOME}/mailsync.lastrun @@ -132,7 +140,7 @@ run_sync() { "$id" >/dev/null # index new messages - command notmuch >/dev/null && notmuch new + command notmuch >/dev/null 2>&1 && notmuch new } # only list new mail, don't sync |