diff options
| -rw-r--r-- | .config/i3blocks/config | 2 | ||||
| -rwxr-xr-x | .local/bin/statusbar/mailbox | 6 | ||||
| -rwxr-xr-x | .local/bin/statusbar/news | 2 |
3 files changed, 6 insertions, 4 deletions
diff --git a/.config/i3blocks/config b/.config/i3blocks/config index 393ea86..407e23e 100644 --- a/.config/i3blocks/config +++ b/.config/i3blocks/config @@ -13,7 +13,6 @@ interval=once signal=11 [news] -label=📰 interval=once signal=6 @@ -34,7 +33,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)" diff --git a/.local/bin/statusbar/news b/.local/bin/statusbar/news index b7ca1a7..a8842ad 100755 --- a/.local/bin/statusbar/news +++ b/.local/bin/statusbar/news @@ -14,4 +14,4 @@ case $BLOCK_BUTTON in <b>Note:</b> Only one instance of newsboat (including updates) may be running at a time." ;; esac - cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" + cat /tmp/newsupdate 2>/dev/null || echo "$(newsboat -x print-unread | awk '{ print "📰 " $1}' | sed s/^0$//g)$(cat ~/.config/newsboat/.update 2>/dev/null)" |
