AutoYADM commit: 2025-03-17 23:00:06
This commit is contained in:
parent
0b9d4c2a68
commit
f5b3ffcde5
11 changed files with 42 additions and 45 deletions
|
@ -1 +1 @@
|
||||||
config##hostname.dpad
|
config##hostname.dbox
|
|
@ -1 +1 @@
|
||||||
kitty.conf##hostname.dpad
|
kitty.conf##hostname.dbox
|
|
@ -1,4 +1,5 @@
|
||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
nohup /home/fic/.config/mail/mail-sync.sh >/dev/null 2>&1 &
|
/home/fic/.config/mail/mail-sync.sh &
|
||||||
exit 0
|
# nohup /home/fic/.config/mail/mail-sync.sh >/dev/null 2>&1 &
|
||||||
|
# exit 0
|
||||||
|
|
|
@ -1,19 +1,19 @@
|
||||||
#!/bin/env bash
|
#!/bin/env bash
|
||||||
|
|
||||||
# mailboxes to monitor
|
|
||||||
MAILBOXES=("personal" "school")
|
|
||||||
# named pipe for receiving refresh events
|
# named pipe for receiving refresh events
|
||||||
# from mail sync script
|
# from mail sync script
|
||||||
PIPE="/tmp/email_refresh_pipe"
|
PIPE="/tmp/email_refresh_pipe"
|
||||||
COUNT="/tmp/email_count"
|
# COUNT="/tmp/email_count"
|
||||||
|
|
||||||
# Create pipe if doesn't exist
|
# Create pipe if doesn't exist
|
||||||
[[ -p "$PIPE" ]] || mkfifo "$PIPE"
|
[[ -p "$PIPE" ]] || mkfifo "$PIPE"
|
||||||
|
|
||||||
if [ ! -e "$COUNT" ]; then
|
# if [ ! -e "$COUNT" ]; then
|
||||||
echo "0" > "$COUNT"
|
# echo "0" > "$COUNT"
|
||||||
fi
|
# fi
|
||||||
|
|
||||||
|
# mailboxes to monitor
|
||||||
|
MAILBOXES=("personal" "school")
|
||||||
# Get unread counts and format for waybar
|
# Get unread counts and format for waybar
|
||||||
get_unread_counts() {
|
get_unread_counts() {
|
||||||
for mailbox in "${MAILBOXES[@]}"; do
|
for mailbox in "${MAILBOXES[@]}"; do
|
||||||
|
@ -25,27 +25,22 @@ get_unread_counts() {
|
||||||
printf "|\n"
|
printf "|\n"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
# run once for initial output
|
# run once for initial output
|
||||||
echo "mail init |"
|
# echo "mail init |"
|
||||||
# begin event loop
|
# begin event loop
|
||||||
while true; do
|
while true; do
|
||||||
# cat blocks until data comes through pipe
|
# cat blocks until data comes through pipe
|
||||||
# redirecting to null b.c. we don't want the
|
# redirecting to null b.c. we don't want the
|
||||||
# pipe's contents to be printed to stdout
|
# pipe's contents to be printed to stdout
|
||||||
PAYLOAD=$(cat /tmp/email_refresh_pipe)
|
PAYLOAD=$(cat /tmp/email_refresh_pipe)
|
||||||
if [ "$PAYLOAD" == "add" ]; then
|
if [ "$PAYLOAD" == "new" ]; then
|
||||||
count=$(cat "$COUNT")
|
echo "m* |"
|
||||||
((count++))
|
# count=$(cat "$COUNT")
|
||||||
echo "$count" > "$COUNT"
|
# ((count++))
|
||||||
echo "new: $(cat "$COUNT") |"
|
# echo "$count" > "$COUNT"
|
||||||
|
# echo "new: $(cat "$COUNT") |"
|
||||||
# elif [ "$PAYLOAD" == "reset" ]; then
|
# elif [ "$PAYLOAD" == "reset" ]; then
|
||||||
# "0" > "$COUNT"
|
# "0" > "$COUNT"
|
||||||
elif [ "$PAYLOAD" == "show_precise" ]; then
|
|
||||||
echo "0" > "$COUNT"
|
|
||||||
get_unread_counts
|
|
||||||
elif [ "$PAYLOAD" == "show_since" ]; then
|
|
||||||
echo "new: $(cat "$COUNT") |"
|
|
||||||
else
|
else
|
||||||
get_unread_counts
|
get_unread_counts
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -23,6 +23,6 @@ notmuch new
|
||||||
# new mail tagging pipeline
|
# new mail tagging pipeline
|
||||||
afew --tag --new
|
afew --tag --new
|
||||||
# signal waybar indicator update
|
# signal waybar indicator update
|
||||||
echo "show_precise" > "$PIPE"
|
echo "off" > "$PIPE"
|
||||||
# generate new ranked addressbook
|
# generate new ranked addressbook
|
||||||
maildir-rank-addr
|
maildir-rank-addr
|
|
@ -5,5 +5,6 @@ PIPE="/tmp/email_refresh_pipe"
|
||||||
# Create pipe if doesn't exist
|
# Create pipe if doesn't exist
|
||||||
[ -p "$PIPE" ] || mkfifo "$PIPE"
|
[ -p "$PIPE" ] || mkfifo "$PIPE"
|
||||||
|
|
||||||
|
echo "new" > "$PIPE"
|
||||||
|
|
||||||
notify-send "New mail in $1 inbox!"
|
notify-send "New mail in $1 inbox!"
|
||||||
echo "add" > "$PIPE"
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
maildir = "~/.mail"
|
maildir = "~/Maildir"
|
||||||
addresses = [
|
addresses = [
|
||||||
"daniel@ficd.ca",
|
"daniel@ficd.ca",
|
||||||
"fichtinger.d@queensu.ca",
|
"fichtinger.d@queensu.ca",
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
config.kdl##hostname.dpad
|
config.kdl##hostname.dbox
|
|
@ -1 +1 @@
|
||||||
config##hostname.dpad
|
config##hostname.dbox
|
|
@ -2,9 +2,9 @@ Videos /home/fic/Videos v
|
||||||
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
|
SyncDocuments /home/fic/SyncDocuments s
|
||||||
Pictures /home/fic/Pictures p
|
|
||||||
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
|
||||||
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
|
||||||
|
Documents /home/fic/Documents d
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue