From f5b3ffcde50e42d7596311270f352417b83a7d56 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Mon, 17 Mar 2025 23:00:06 -0400 Subject: [PATCH] AutoYADM commit: 2025-03-17 23:00:06 --- .config/ghostty/config | 2 +- .config/kitty/kitty.conf | 2 +- .config/mail/async-mail.sh | 5 +- .config/mail/mail-indicator.sh | 63 +++++++++---------- ...il-sync.sh##hostname.dbox => mail-sync.sh} | 2 +- ...ync.sh##hostname.dpad => mail-sync.sh.bak} | 0 .config/mail/newmail.sh | 3 +- .config/maildir-rank-addr/config | 2 +- .config/niri/config.kdl | 2 +- .config/sway/config | 2 +- .config/yazi/bookmark | 4 +- 11 files changed, 42 insertions(+), 45 deletions(-) rename .config/mail/{mail-sync.sh##hostname.dbox => mail-sync.sh} (95%) rename .config/mail/{mail-sync.sh##hostname.dpad => mail-sync.sh.bak} (100%) 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/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/async-mail.sh b/.config/mail/async-mail.sh index 218a45e0..e7d9ae98 100755 --- a/.config/mail/async-mail.sh +++ b/.config/mail/async-mail.sh @@ -1,4 +1,5 @@ #!/bin/env bash -nohup /home/fic/.config/mail/mail-sync.sh >/dev/null 2>&1 & -exit 0 +/home/fic/.config/mail/mail-sync.sh & +# nohup /home/fic/.config/mail/mail-sync.sh >/dev/null 2>&1 & +# exit 0 diff --git a/.config/mail/mail-indicator.sh b/.config/mail/mail-indicator.sh index 0e2e6587..7e96fe00 100755 --- a/.config/mail/mail-indicator.sh +++ b/.config/mail/mail-indicator.sh @@ -1,52 +1,47 @@ #!/bin/env bash -# mailboxes to monitor -MAILBOXES=("personal" "school") # named pipe for receiving refresh events # from mail sync script PIPE="/tmp/email_refresh_pipe" -COUNT="/tmp/email_count" +# COUNT="/tmp/email_count" # Create pipe if doesn't exist [[ -p "$PIPE" ]] || mkfifo "$PIPE" -if [ ! -e "$COUNT" ]; then - echo "0" > "$COUNT" -fi +# if [ ! -e "$COUNT" ]; then +# echo "0" > "$COUNT" +# fi +# mailboxes to monitor +MAILBOXES=("personal" "school") # Get unread counts and format for waybar get_unread_counts() { - for mailbox in "${MAILBOXES[@]}"; do - count=$(notmuch count --output=messages "tag:unread and path:$mailbox/**") - printf "%s: %s " "$mailbox" "$count" - done - # we print a newline to let waybar know to display - # what we just printed - printf "|\n" + for mailbox in "${MAILBOXES[@]}"; do + count=$(notmuch count --output=messages "tag:unread and path:$mailbox/**") + printf "%s: %s " "$mailbox" "$count" + done + # we print a newline to let waybar know to display + # what we just printed + printf "|\n" } - # 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" == "add" ]; then - count=$(cat "$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") |" - else - get_unread_counts - fi + # 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 + echo "m* |" + # count=$(cat "$COUNT") + # ((count++)) + # echo "$count" > "$COUNT" + # echo "new: $(cat "$COUNT") |" + # elif [ "$PAYLOAD" == "reset" ]; then + # "0" > "$COUNT" + else + get_unread_counts + fi done diff --git a/.config/mail/mail-sync.sh##hostname.dbox b/.config/mail/mail-sync.sh similarity index 95% rename from .config/mail/mail-sync.sh##hostname.dbox rename to .config/mail/mail-sync.sh index 3031dfa6..689d6e07 100755 --- a/.config/mail/mail-sync.sh##hostname.dbox +++ b/.config/mail/mail-sync.sh @@ -23,6 +23,6 @@ notmuch new # new mail tagging pipeline afew --tag --new # signal waybar indicator update -echo "show_precise" > "$PIPE" +echo "off" > "$PIPE" # generate new ranked addressbook maildir-rank-addr diff --git a/.config/mail/mail-sync.sh##hostname.dpad b/.config/mail/mail-sync.sh.bak similarity index 100% rename from .config/mail/mail-sync.sh##hostname.dpad rename to .config/mail/mail-sync.sh.bak diff --git a/.config/mail/newmail.sh b/.config/mail/newmail.sh index 8a7113e1..70d822cc 100755 --- a/.config/mail/newmail.sh +++ b/.config/mail/newmail.sh @@ -5,5 +5,6 @@ PIPE="/tmp/email_refresh_pipe" # Create pipe if doesn't exist [ -p "$PIPE" ] || mkfifo "$PIPE" +echo "new" > "$PIPE" + notify-send "New mail in $1 inbox!" -echo "add" > "$PIPE" diff --git a/.config/maildir-rank-addr/config b/.config/maildir-rank-addr/config index 67d37129..222e4bf7 100644 --- a/.config/maildir-rank-addr/config +++ b/.config/maildir-rank-addr/config @@ -1,4 +1,4 @@ -maildir = "~/.mail" +maildir = "~/Maildir" addresses = [ "daniel@ficd.ca", "fichtinger.d@queensu.ca", 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 diff --git a/.config/yazi/bookmark b/.config/yazi/bookmark index d6057da9..2e73b6e9 100644 --- a/.config/yazi/bookmark +++ b/.config/yazi/bookmark @@ -2,9 +2,9 @@ Videos /home/fic/Videos v Videos /home/fic/Videos/ v SyncDocuments /home/fic/SyncDocuments/ s SyncDocuments /home/fic/SyncDocuments s -Pictures /home/fic/Pictures p Pictures /home/fic/Pictures/ p +Pictures /home/fic/Pictures p Downloads /home/fic/Downloads D Downloads /home/fic/Downloads/ D -Documents /home/fic/Documents d Documents /home/fic/Documents/ d +Documents /home/fic/Documents d