clone of my dotfiles.ssp.sh
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

stow: mutt msmt

sspaeti 39484379 c2d32539

+156 -9
msmtp/.gitkeep

This is a binary file and will not be displayed.

+19
mutt/.config/mutt/Makefile
··· 1 + .PHONY: start logs help 2 + 3 + .DEFAULT_GOAL := loop 4 + 5 + # Start mail sync 6 + loop: 7 + ~/.config/mutt/launchctl/mail_sync_watch.sh --loop 8 + 9 + # Show logs 10 + logs: 11 + tail -f ~/.config/mutt/logs/mail_sync.log 12 + 13 + # Show help 14 + help: 15 + @echo "Mail Sync Makefile commands:" 16 + @echo " make start - Start mail sync loop" 17 + @echo " make logs - Show mail sync logs" 18 + @echo "" 19 + @echo "Note: Use Ctrl+C to stop the sync"
+73
mutt/.config/mutt/sync/Makefile
··· 1 + .DEFAULT_GOAL := sync_status 2 + 3 + # Makefile for managing Neomutt sync launchd job 4 + 5 + # Variables 6 + PLIST_FILE = ~/Library/LaunchAgents/com.user.neomuttsync.plist 7 + LABEL = com.user.neomuttsync 8 + LOG_FILE = ~/.config/mutt/logs/sync_status.log 9 + 10 + # Phony targets 11 + .PHONY: load unload reload status check help sync_status next_run 12 + 13 + # Default target 14 + help: 15 + @echo "Usage:" 16 + @echo " make load - Load the launchd job" 17 + @echo " make unload - Unload the launchd job" 18 + @echo " make reload - Reload the launchd job" 19 + @echo " make status - Check the status of the launchd job" 20 + @echo " make check - Validate the plist file" 21 + @echo " make sync_status - Check if a sync is currently running" 22 + @echo " make next_run - Show the next scheduled run time" 23 + 24 + # Load the launchd job 25 + load: 26 + launchctl load $(PLIST_FILE) 27 + @echo "Launchd job loaded." 28 + 29 + # Unload the launchd job 30 + unload: 31 + launchctl unload $(PLIST_FILE) 32 + @echo "Launchd job unloaded." 33 + 34 + # Reload the launchd job 35 + reload: unload load 36 + 37 + # Check the status of the launchd job 38 + status: 39 + @launchctl list | grep $(LABEL) || echo "Job is not loaded." 40 + 41 + 42 + # Check the status of the launchd job 43 + status2: 44 + @echo "Job Status:" 45 + @launchctl list $(LABEL) || echo "Job is not loaded." 46 + @echo "\nNext Run Time:" 47 + @launchctl print $(LABEL) | grep 'next' || echo "Unable to determine next run time." 48 + @echo "\nLast Exit Status:" 49 + @launchctl print $(LABEL) | grep 'last exit code' || echo "No exit status available." 50 + 51 + # Validate the plist file 52 + check: 53 + plutil -lint $(PLIST_FILE) 54 + 55 + # Check if a sync is currently running 56 + sync_status: 57 + @if pgrep -f "neomutt_sync.sh" > /dev/null; then \ 58 + echo "Sync is currently running."; \ 59 + ps aux | grep "[n]eomutt_sync.sh"; \ 60 + else \ 61 + echo "No sync is currently running."; \ 62 + echo "Last sync status:"; \ 63 + tail -n 1 $(LOG_FILE); \ 64 + fi 65 + 66 + # Show the next scheduled run time 67 + next_run: 68 + @next_run_time=$$(launchctl list $(LABEL) | awk '/next exit/ {print $$1}'); \ 69 + if [ -n "$$next_run_time" ]; then \ 70 + date -r $$next_run_time; \ 71 + else \ 72 + echo "Unable to determine next run time. Check if the job is loaded."; \ 73 + fi
+18
mutt/.config/mutt/sync/com.user.neomuttsync.plist
··· 1 + <?xml version="1.0" encoding="UTF-8"?> 2 + <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 3 + <plist version="1.0"> 4 + <dict> 5 + <key>Label</key> 6 + <string>com.user.neomuttsync</string> 7 + <key>ProgramArguments</key> 8 + <array> 9 + <string>/bin/bash</string> 10 + <string>-c</string> 11 + <string>~/.config/mutt/sync/neomutt_sync.sh</string> 12 + </array> 13 + <key>StartInterval</key> 14 + <integer>14400</integer> 15 + <key>RunAtLoad</key> 16 + <true/> 17 + </dict> 18 + </plist>
+42
mutt/.config/mutt/sync/neomutt_sync.sh
··· 1 + #!/bin/bash 2 + 3 + # Log file path 4 + LOG_FILE=~/.config/mutt/logs/sync_status.log 5 + 6 + # Function to check if connected to Wi-Fi 7 + check_wifi() { 8 + wifi_name=$(networksetup -getairportnetwork en0 | awk -F": " '{print $2}') 9 + if [ -n "$wifi_name" ]; then 10 + return 0 # Connected to Wi-Fi 11 + else 12 + return 1 # Not connected to Wi-Fi 13 + fi 14 + } 15 + 16 + # Log start time 17 + echo "Sync started at $(date)" >> "$LOG_FILE" 18 + 19 + # Check if connected to Wi-Fi 20 + if check_wifi; then 21 + # Run the first sync 22 + offlineimap -a sspaeti.com 23 + 24 + # Wait for 2 seconds 25 + sleep 2 26 + 27 + # Run the screener 28 + ~/.config/mutt/initial_screening.sh >> ~/.config/mutt/logs/screening.log 2>&1 29 + 30 + # Wait for 2 seconds 31 + sleep 2 32 + 33 + # Run the second sync 34 + offlineimap -a sspaeti.com 35 + 36 + echo "Sync completed successfully at $(date)" >> "$LOG_FILE" 37 + else 38 + echo "Not connected to Wi-Fi. Sync not performed at $(date)" >> "$LOG_FILE" 39 + fi 40 + 41 + # Remove log entries older than 7 days 42 + find "$LOG_FILE" -mtime +7 -delete
+4
mutt/.config/mutt/update_screen_lists.sh
··· 1 + #!/bin/bash 2 + 3 + # Reload Mutt configuration 4 + neomutt -F ~/.config/mutt/muttrc
mutt/color.muttrc mutt/.config/mutt/color.muttrc
mutt/generate_pattern.sh mutt/.config/mutt/generate_pattern.sh
mutt/generate_pattern_in.sh mutt/.config/mutt/generate_pattern_in.sh
mutt/get_hey_emails/get_screener_emails_from_hey.py mutt/.config/mutt/get_hey_emails/get_screener_emails_from_hey.py
mutt/initial_screening.sh mutt/.config/mutt/initial_screening.sh
mutt/launchctl/initial_screening.plist mutt/.config/mutt/launchctl/initial_screening.plist
mutt/launchctl/loading-them.sh mutt/.config/mutt/launchctl/loading-them.sh
mutt/launchctl/mail_sync_watch.sh mutt/.config/mutt/launchctl/mail_sync_watch.sh
mutt/launchctl/offlineimap_sspaeti.plist mutt/.config/mutt/launchctl/offlineimap_sspaeti.plist
mutt/mailcap mutt/.config/mutt/mailcap
mutt/muttrc mutt/.config/mutt/muttrc
-1
mutt/screened_in.txt
··· 1 - sbbclient@order.info.sbb.ch
-4
mutt/screened_out.txt
··· 1 - bla@bla.com 2 - no-reply@dsb-email.dk 3 - mail@barbannews.com 4 - info@i.drop.com
mutt/signature mutt/.config/mutt/signature
mutt/templates/email.html mutt/.config/mutt/templates/email.html
mutt/tests/emails.txt mutt/.config/mutt/tests/emails.txt
mutt/tests/test_email_extraction.sh mutt/.config/mutt/tests/test_email_extraction.sh
-4
mutt/update_screen_lists.sh
··· 1 - #!/bin/bash 2 - 3 - # Reload Mutt configuration 4 - neomutt -F ~/.config/mutt/muttrc