home/config/polybar/scripts/inbox-imap-shellnetrc.sh

13 lines
258 B
Bash
Raw Normal View History

2020-11-17 13:58:04 +01:00
#!/bin/sh
SERVER="mail.darkou.fr"
NETRC=".netrc"
inbox=$(curl -sf --netrc-file "$NETRC" -X "STATUS INBOX (UNSEEN)" imaps://"$SERVER"/INBOX | tr -d -c "[:digit:]")
if [ "$inbox" ] && [ "$inbox" -gt 0 ]; then
echo "# $inbox"
else
echo "0 unread"
fi