diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 393ea86..3694664 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -34,7 +34,6 @@ interval=18000 signal=5 [mailbox] -label=📬 interval=180 signal=12 diff --git a/.local/bin/statusbar/mailbox b/.local/bin/statusbar/mailbox index 21c85ab..3ace5f5 100755 --- a/.local/bin/statusbar/mailbox +++ b/.local/bin/statusbar/mailbox @@ -13,4 +13,8 @@ case $BLOCK_BUTTON in - Middle click syncs mail" ;; esac -echo "$(du -a ~/.local/share/mail/*/INBOX/new/* 2>/dev/null | sed -n '$=')$(cat /tmp/imapsyncicon_$USER 2>/dev/null)" +unread="$(find ~/.local/share/mail/*/INBOX/new/* -type f | wc -l 2>/dev/null)" + +icon="$(cat "/tmp/imapsyncicon_$USER")" + +[ "$unread" = "0" ] && [ "$icon" = "" ] || echo "📬 $unread$(cat "/tmp/imapsyncicon_$USER" 2>/dev/null)"