diff options
Diffstat (limited to 'etc')
| -rwxr-xr-x | etc/mailsync.sh | 23 | ||||
| -rw-r--r-- | etc/muttcol | 113 | ||||
| -rw-r--r-- | etc/notify.opus | bin | 0 -> 28900 bytes | 
3 files changed, 86 insertions, 50 deletions
| diff --git a/etc/mailsync.sh b/etc/mailsync.sh new file mode 100755 index 0000000..61eeade --- /dev/null +++ b/etc/mailsync.sh @@ -0,0 +1,23 @@ +#!/bin/sh +# This script will run offlineimap and check +# for new email if there is an internet connection. +# +# If it detects new mail, it uses mpv to play a +# notification sound: notify.opus +# +# I have this run as a cronjob every 5 minutes. + +# Check for internet connection. Exit script if none. +ping -q -w 1 -c 1 `ip r | grep default | cut -d ' ' -f 3` >/dev/null || exit + +# Get current number of new mail, then begin sync. +ori=$(find ~/.mail -wholename '*/new/*' | grep -vi "spam\|trash\|junk" | wc -l) +offlineimap -o + +# Recount new mail. +new=$(find ~/.mail -wholename '*/new/*' | grep -vi "spam\|trash\|junk" | wc -l) + +# If new mail has grown, play a notification. +if [ "$new" -gt "$ori" ]; then +	mpv --quiet ~/.config/mutt/etc/notify.opus +fi diff --git a/etc/muttcol b/etc/muttcol index 78704fd..8524157 100644 --- a/etc/muttcol +++ b/etc/muttcol @@ -1,58 +1,71 @@  # vim: filetype=neomuttrc -mono bold bold -mono underline underline -mono indicator reverse + +# Default index colors:  color index yellow default '.*'  color index_author red default '.*'  color index_number blue default -color index_subject cyan default '.s' -color index_size green default +color index_subject cyan default '.*' + +# For new mail: +color index brightyellow black "~N" +color index_author brightred black "~N" +color index_subject brightcyan black "~N" + +# Header colors: +color header blue default ".*" +color header brightmagenta default "^(From)" +color header brightcyan default "^(Subject)" +color header brightwhite default "^(CC|BCC)" + +mono bold bold +mono underline underline +mono indicator reverse +mono error bold  color normal default default -color body brightred default [\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+ -color body brightblue default (https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+ -color indicator cyan black -color sidebar_highlight black color8 +color indicator brightblack white +color sidebar_highlight red default  color sidebar_divider color8 black  color sidebar_flagged red black  color sidebar_new green black -color normal        brightyellow    default -color error         red             default -color tilde         black           default -color message       cyan            default -color markers       red             white -color attachment    white           default -color search        brightmagenta   default -color status        brightyellow    black -color indicator     brightblack     yellow -mono  bold          bold -mono  underline     underline -mono  indicator     reverse -mono  error         bold -color hdrdefault    brightgreen     default -color header        brightyellow    default         "^(From)" -color header        blue            default         "^(Subject)" -color quoted        green            default -color quoted1       blue            default -color quoted2       cyan          default -color quoted3       yellow             default -color quoted4       red       default -color quoted5       brightred       default -color signature     brightgreen     default -color bold          black           default -color underline     black           default -color normal        default         default -color body          brightcyan      default         "[;:][-o][)/(|]"    # emoticons -color body          brightcyan      default         "[;:][)(|]"         # emoticons -color body          brightcyan      default         "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\ -                                                     |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\ -                                                     |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?" -color body          brightcyan      default         "[ ][*][^*]*[*][ ]?" # more emoticon? -color body          brightcyan      default         "[ ]?[*][^*]*[*][ ]" # more emoticon? -color body          red             default         "(BAD signature)" -color body          cyan            default         "(Good signature)" -color body          brightblack     default         "^gpg: Good signature .*" -color body          brightyellow    default         "^gpg: " -color body          brightyellow    red             "^gpg: BAD signature from.*" -mono  body          bold                            "^gpg: Good signature" -mono  body          bold                            "^gpg: BAD signature from.*" -color body          red             default         "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" +color normal brightyellow default +color error red default +color tilde black default +color message cyan default +color markers red white +color attachment white default +color search brightmagenta default +color status brightyellow black +color hdrdefault brightgreen default +color quoted green default +color quoted1 blue default +color quoted2 cyan default +color quoted3 yellow default +color quoted4 red default +color quoted5 brightred default +color signature brightgreen default +color bold black default +color underline black default +color normal default default + +color body brightred default "[\-\.+_a-zA-Z0-9]+@[\-\.a-zA-Z0-9]+" # Email addresses +color body brightblue default "(https?|ftp)://[\-\.,/%~_:?&=\#a-zA-Z0-9]+" # URL +color body green default "\`[^\`]*\`" # Green text between ` and ` +color body brightblue default "^# \.*" # Headings as bold blue +color body brightcyan default "^## \.*" # Subheadings as bold cyan +color body brightgreen default "^### \.*" # Subsubheadings as bold green +color body yellow default "^(\t| )*(-|\\*) \.*" # List items as yellow +color body brightcyan default "[;:][-o][)/(|]" # emoticons +color body brightcyan default "[;:][)(|]" # emoticons +color body brightcyan default "[*]?((N)?ACK|CU|LOL|SCNR|BRB|BTW|CWYL|\ + |FWIW|vbg|GD&R|HTH|HTHBE|IMHO|IMNSHO|\ + |IRL|RTFM|ROTFL|ROFL|YMMV)[*]?" +color body brightcyan default "[ ][*][^*]*[*][ ]?" # more emoticon? +color body brightcyan default "[ ]?[*][^*]*[*][ ]" # more emoticon? +color body red default "(BAD signature)" +color body cyan default "(Good signature)" +color body brightblack default "^gpg: Good signature .*" +color body brightyellow default "^gpg: " +color body brightyellow red "^gpg: BAD signature from.*" +mono body bold "^gpg: Good signature" +mono body bold "^gpg: BAD signature from.*" +color body red default "([a-z][a-z0-9+-]*://(((([a-z0-9_.!~*'();:&=+$,-]|%[0-9a-f][0-9a-f])*@)?((([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?|[0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+)(:[0-9]+)?)|([a-z0-9_.!~*'()$,;:@&=+-]|%[0-9a-f][0-9a-f])+)(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*(/([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*(;([a-z0-9_.!~*'():@&=+$,-]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?(#([a-z0-9_.!~*'();/?:@&=+$,-]|%[0-9a-f][0-9a-f])*)?|(www|ftp)\\.(([a-z0-9]([a-z0-9-]*[a-z0-9])?)\\.)*([a-z]([a-z0-9-]*[a-z0-9])?)\\.?(:[0-9]+)?(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*(/([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*(;([-a-z0-9_.!~*'():@&=+$,]|%[0-9a-f][0-9a-f])*)*)*)?(\\?([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?(#([-a-z0-9_.!~*'();/?:@&=+$,]|%[0-9a-f][0-9a-f])*)?)[^].,:;!)? \t\r\n<>\"]" diff --git a/etc/notify.opus b/etc/notify.opusBinary files differ new file mode 100644 index 0000000..a76ce32 --- /dev/null +++ b/etc/notify.opus | 
