diff --git a/.config/ghostty/config b/.config/ghostty/config index cb232026..64315017 120000 --- a/.config/ghostty/config +++ b/.config/ghostty/config @@ -1 +1 @@ -config##hostname.dpad \ No newline at end of file +config##hostname.dbox \ No newline at end of file diff --git a/.config/goimapnotify/goimapnotify.yaml b/.config/goimapnotify/goimapnotify.yaml index ac62599e..26b699ae 100644 --- a/.config/goimapnotify/goimapnotify.yaml +++ b/.config/goimapnotify/goimapnotify.yaml @@ -9,17 +9,17 @@ configurations: username: daniel@ficd.ca passwordCMD: 'pass show proton/bridge' xoAuth2: false - onNewMail: '/home/fic/.config/mail/mail-sync.sh' - onDeletedMail: '/home/fic/.config/mail/mail-sync.sh' + # 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' + # onNewMail: '/home/fic/.config/mail/mail-sync.sh' - host: outlook.office365.com port: 993 @@ -30,12 +30,12 @@ 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' + # 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' + # onNewMail: '/home/fic/.config/mail/mail-sync.sh' diff --git a/.config/kitty/kitty.conf b/.config/kitty/kitty.conf index 067de165..3f04ff08 120000 --- a/.config/kitty/kitty.conf +++ b/.config/kitty/kitty.conf @@ -1 +1 @@ -kitty.conf##hostname.dpad \ No newline at end of file +kitty.conf##hostname.dbox \ No newline at end of file diff --git a/.config/mail/mail-indicator.sh b/.config/mail/mail-indicator.sh index 4ff26b67..71bbf7f8 100755 --- a/.config/mail/mail-indicator.sh +++ b/.config/mail/mail-indicator.sh @@ -5,9 +5,11 @@ MAILBOXES=("personal" "school") # named pipe for receiving refresh events # from mail sync script PIPE="/tmp/email_refresh_pipe" +COUNT="/tmp/email_count" # Create pipe if doesn't exist [[ -p "$PIPE" ]] || mkfifo "$PIPE" +[[ -e "$COUNT" ]] || echo "0" > "$COUNT" # Get unread counts and format for waybar get_unread_counts() { @@ -22,13 +24,21 @@ get_unread_counts() { # run once for initial output -get_unread_counts +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 - cat /tmp/email_refresh_pipe > /dev/null - # print unread indicator to stdout - get_unread_counts + PAYLOAD=$(cat /tmp/email_refresh_pipe) + if [ "$PAYLOAD" == "new" ]; then + count=$(cat "$COUNT") + ((count++)) > "$COUNT" + elif [ "$PAYLOAD" == "reset" ]; then + "0" > "$COUNT" + elif [ "$PAYLOAD" == "show_precise" ]; then + get_unread_counts + elif [ "$PAYLOAD" == "show_since" ]; then + echo "new: $(cat "$COUNT")" + fi done diff --git a/.config/mail/newmail.sh b/.config/mail/newmail.sh index 9739d115..76755048 100755 --- a/.config/mail/newmail.sh +++ b/.config/mail/newmail.sh @@ -1,4 +1,4 @@ #!/bin/env bash notify-send "New mail in $1 inbox!" -/home/fic/.config/mail/mail-sync.sh +# /home/fic/.config/mail/mail-sync.sh diff --git a/.config/niri/config.kdl b/.config/niri/config.kdl index a63220a7..e6a5eacd 120000 --- a/.config/niri/config.kdl +++ b/.config/niri/config.kdl @@ -1 +1 @@ -config.kdl##hostname.dpad \ No newline at end of file +config.kdl##hostname.dbox \ No newline at end of file diff --git a/.config/sway/config b/.config/sway/config index cb232026..64315017 120000 --- a/.config/sway/config +++ b/.config/sway/config @@ -1 +1 @@ -config##hostname.dpad \ No newline at end of file +config##hostname.dbox \ No newline at end of file