Skip to content

Instantly share code, notes, and snippets.

@0x07CB
Created February 1, 2024 18:18
Show Gist options
  • Save 0x07CB/3f1fb9c50af3d1a945c7f3a3f7655a99 to your computer and use it in GitHub Desktop.
Save 0x07CB/3f1fb9c50af3d1a945c7f3a3f7655a99 to your computer and use it in GitHub Desktop.
claws-automation
#!/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