From ece7017d1e9d26b4095d07f4fb218b8b863c4c1f Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Mon, 17 Mar 2025 22:45:07 -0400 Subject: [PATCH] AutoYADM commit: 2025-03-17 22:45:07 --- .config/goimapnotify/goimapnotify.yaml | 9 ++------- .config/mail/mail-indicator.sh | 22 +++++++++++++++------- .config/mail/mail-sync.sh##hostname.dbox | 2 +- .config/mail/newmail.sh | 7 ++++++- .config/yazi/bookmark | 4 ++-- 5 files changed, 26 insertions(+), 18 deletions(-) diff --git a/.config/goimapnotify/goimapnotify.yaml b/.config/goimapnotify/goimapnotify.yaml index 26b699ae..700bc1b4 100644 --- a/.config/goimapnotify/goimapnotify.yaml +++ b/.config/goimapnotify/goimapnotify.yaml @@ -10,16 +10,14 @@ configurations: passwordCMD: 'pass show proton/bridge' xoAuth2: false # onNewMail: '/home/fic/.config/mail/mail-sync.sh' - # onDeletedMail: '/home/fic/.config/mail/mail-sync.sh' wait: 20 boxes: - mailbox: INBOX - # onNewMail: '/home/fic/.config/mail/newmail.sh personal' + onNewMail: '/home/fic/.config/mail/newmail.sh personal' - mailbox: Sent - # onNewMail: '/home/fic/.config/mail/mail-sync.sh' - host: outlook.office365.com port: 993 @@ -30,12 +28,9 @@ configurations: username: 18daf3@queensu.ca passwordCMD: '~/tools/mutt_oauth2.py ~/tools/tokenfile-test' xoAuth2: true - # onNewMail: '/home/fic/.config/mail/mail-sync.sh' - # onDeletedMail: '/home/fic/.config/mail/mail-sync.sh' wait: 20 boxes: - mailbox: INBOX - # onNewMail: '/home/fic/.config/mail/newmail.sh school' + onNewMail: '/home/fic/.config/mail/newmail.sh school' - mailbox: Sent Items - # onNewMail: '/home/fic/.config/mail/mail-sync.sh' diff --git a/.config/mail/mail-indicator.sh b/.config/mail/mail-indicator.sh index 71bbf7f8..0e2e6587 100755 --- a/.config/mail/mail-indicator.sh +++ b/.config/mail/mail-indicator.sh @@ -9,7 +9,10 @@ COUNT="/tmp/email_count" # Create pipe if doesn't exist [[ -p "$PIPE" ]] || mkfifo "$PIPE" -[[ -e "$COUNT" ]] || echo "0" > "$COUNT" + +if [ ! -e "$COUNT" ]; then + echo "0" > "$COUNT" +fi # Get unread counts and format for waybar get_unread_counts() { @@ -24,21 +27,26 @@ get_unread_counts() { # run once for initial output -echo "mail init" +echo "mail init |" # begin event loop while true; do # cat blocks until data comes through pipe # redirecting to null b.c. we don't want the # pipe's contents to be printed to stdout PAYLOAD=$(cat /tmp/email_refresh_pipe) - if [ "$PAYLOAD" == "new" ]; then + if [ "$PAYLOAD" == "add" ]; then count=$(cat "$COUNT") - ((count++)) > "$COUNT" - elif [ "$PAYLOAD" == "reset" ]; then - "0" > "$COUNT" + ((count++)) + echo "$count" > "$COUNT" + echo "new: $(cat "$COUNT") |" + # elif [ "$PAYLOAD" == "reset" ]; then + # "0" > "$COUNT" elif [ "$PAYLOAD" == "show_precise" ]; then + echo "0" > "$COUNT" get_unread_counts elif [ "$PAYLOAD" == "show_since" ]; then - echo "new: $(cat "$COUNT")" + echo "new: $(cat "$COUNT") |" + else + get_unread_counts fi done diff --git a/.config/mail/mail-sync.sh##hostname.dbox b/.config/mail/mail-sync.sh##hostname.dbox index 3cd9e013..3031dfa6 100755 --- a/.config/mail/mail-sync.sh##hostname.dbox +++ b/.config/mail/mail-sync.sh##hostname.dbox @@ -23,6 +23,6 @@ notmuch new # new mail tagging pipeline afew --tag --new # signal waybar indicator update -echo "refresh" > "$PIPE" +echo "show_precise" > "$PIPE" # generate new ranked addressbook maildir-rank-addr diff --git a/.config/mail/newmail.sh b/.config/mail/newmail.sh index 76755048..8a7113e1 100755 --- a/.config/mail/newmail.sh +++ b/.config/mail/newmail.sh @@ -1,4 +1,9 @@ #!/bin/env bash +PIPE="/tmp/email_refresh_pipe" + +# Create pipe if doesn't exist +[ -p "$PIPE" ] || mkfifo "$PIPE" + notify-send "New mail in $1 inbox!" -# /home/fic/.config/mail/mail-sync.sh +echo "add" > "$PIPE" diff --git a/.config/yazi/bookmark b/.config/yazi/bookmark index 6f03de7a..26971fb3 100644 --- a/.config/yazi/bookmark +++ b/.config/yazi/bookmark @@ -1,10 +1,10 @@ Videos /home/fic/Videos v Videos /home/fic/Videos/ v -SyncDocuments /home/fic/SyncDocuments s SyncDocuments /home/fic/SyncDocuments/ s +SyncDocuments /home/fic/SyncDocuments s Pictures /home/fic/Pictures/ p Pictures /home/fic/Pictures p -Downloads /home/fic/Downloads D Downloads /home/fic/Downloads/ D +Downloads /home/fic/Downloads D Documents /home/fic/Documents d Documents /home/fic/Documents/ d