print newline if zero for news and mailcount via printf

This commit is contained in:
Alexander Bocken 2020-09-17 13:44:38 +02:00
parent 7edeec270d
commit bc32fcc81f
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8
2 changed files with 4 additions and 6 deletions

View File

@ -1,7 +1,4 @@
#!/bin/bash #!/bin/bash
num=$(find ~/.local/share/mail/*/INBOX/new -type f | wc -l) num=$(find ~/.local/share/mail/*/INBOX/new -type f | wc -l)
if [ $num != 0 ]; then [ $num != 0 ] && printf "📬%s" "$num"
echo "📬"$num printf '\n'
else
echo ""
fi

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
newsboat -x reload newsboat -x reload
num=$( 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)") num=$( 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)")
[ "$num" = "" ] || echo 📰$num [ "$num" = "" ] || printf "📰%s" "$num"
printf '\n'