diff options
Diffstat (limited to 'scripts/.local/bin/sb-mailbox')
| -rwxr-xr-x | scripts/.local/bin/sb-mailbox | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scripts/.local/bin/sb-mailbox b/scripts/.local/bin/sb-mailbox new file mode 100755 index 0000000..451c129 --- /dev/null +++ b/scripts/.local/bin/sb-mailbox @@ -0,0 +1,10 @@ +#!/bin/sh + +# Displays number of unread mail and an loading icon if updating. +# When clicked, brings up `neomutt`. + +unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)" + +pidof mbsync >/dev/null 2>&1 && icon="U" + +[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "$unread$icon" |
