More tweaking with statusbar.

This commit is contained in:
Bartek Stalewski 2022-04-15 20:17:46 +02:00
parent 4ff14f25fd
commit c72f3c4a1c
6 changed files with 16 additions and 15 deletions

View file

@ -9,8 +9,9 @@ for i in $(cat ~/.local/share/passwords); do
count=$(curl -s --user "${user}:${pass}" https://mail.google.com/mail/feed/atom/ | grep -oPm1 "(?<=<title>)[^<]+" | sed '1d' | wc -l 2>/dev/null)
[ $count -ne 0 ] && export unread=$((unread + count))
if [ $user = 'ftpd@insomniac.pl' ]; then
count=$(curl -s --user "${user}:${pass}" https://mail.google.com/mail/feed/atom/sites | grep -oPm1 "(?<=<title>)[^<]+" | sed '1d' | wc -l 2>/dev/null)
[ $count -ne 0 ] && export unread=$((unread + count))
scount=$(curl -s --user "${user}:${pass}" https://mail.google.com/mail/feed/atom/sites | grep -oPm1 "(?<=<title>)[^<]+" | sed '1d' | wc -l 2>/dev/null)
[ $scount -ne 0 ] && export unread=$((unread + scount))
fi
done
[ "$unread" -eq 0 ] && printf "" || printf "^c#ffffff^^b#005577^\uf7aa new mail: ${unread}^d^"
[ "$unread" -ne 0 ] && printf "\uf7aa ^c#ffffff^^b#005577^new mail: ${unread}^d^"