Created
February 1, 2024 18:18
-
-
Save 0x07CB/3f1fb9c50af3d1a945c7f3a3f7655a99 to your computer and use it in GitHub Desktop.
claws-automation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
email_inbox_total=$(claws-mail --status-full inbox | tail -n 1 | awk '{$1=""; $2=""; print}') | |
claws-mail --receive-all | |
email_inbox_total_new=$(claws-mail --status-full inbox | tail -n 1 | awk '{$1=""; $2=""; print}') | |
if [[ $email_inbox_total_new -gt $email_inbox_total ]]; then | |
notify-send "New mail received (email)" "You have $(( $email_inbox_total_new - $email_inbox_total )) new mail(s) in your inbox." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment