all repos — dotfiles @ 8263eac4ab19879dd3f6fd0fdf16132f40af9d5a

linux dotfiles

i3blocks/mail

1 2 3 4 5 6 7 8 9 10 11 12 13
#!/bin/sh

case $BLOCK_BUTTON in
	6) "$TERMINAL" -e "$EDITOR" "$0" ;;
esac

unread="$(find "${XDG_DATA_HOME:-$HOME/.local/share}"/mail/*/[Ii][Nn][Bb][Oo][Xx]/new/* -type f | wc -l 2>/dev/null)"
mailicon=$(echo -en "<span font='Font Awesome 5 Free'>\uf0e0</span>")

pidof mbsync >/dev/null 2>&1 && icon=$(echo -en "<span font='Font Awesome 5 Free 8'>\uf2f1</span>")

# [ "$unread" = "0" ] && [ "$icon" = "" ] || echo -e "<span color='#1e82d9'>$mailicon $unread $icon</span>"
[ "$unread" = "0" ] || echo -e "<span color='#1e82d9'>$mailicon $unread $icon</span>"