chezmoi/dot_config/polybar/polybar-scripts/polybar-scripts/inbox-imap-shellnetrc/inbox-imap-shellnetrc.sh
2020-07-13 14:31:48 +02:00

13 lines
236 B
Bash

#!/bin/sh
SERVER=""
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 ""
fi