commit 03cb5d0a1f4db328c29e5f5387aed3018b40b8a3
parent eeecc03413ae32a38f4b392f9c22192d1028f7df
Author: pyratebeard <root@pyratebeard.net>
Date: Thu, 25 Feb 2021 15:40:50 +0000
colours and styling. mailfmt script for html emails. updated mailcap
Diffstat:
4 files changed, 88 insertions(+), 75 deletions(-)
diff --git a/bin/bin/mailfmt b/bin/bin/mailfmt
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+w=$(tput cols)
+if [ -z "$w" ] || [ "$w" -gt 120 ] ; then
+ w=120
+fi
+
+# trim mutt [-- Attachment --] headers
+grep -vE -- '\[-- .* --\]$' | fmt -s -w $w
diff --git a/mutt/.mailcap b/mutt/.mailcap
@@ -1,2 +1,70 @@
-text/html; /usr/bin/firefox %s >/dev/null 2>&1; needsterminal
-text/html; lynx -dump %s; nametemplate=%s.html; copiusoutput
+# Example mailcap file for Reddit Terminal Viewer
+# https://github.com/michael-lazar/rtv/
+#
+# Copy the contents of this file to {HOME}/.mailcap, or point to it using $MAILCAPS
+# Then launch RTV using the --enable-media flag. All shell commands defined in
+# this file depend on external programs that must be installed on your system.
+#
+# HELP REQUESTED! If you come up with your own commands (especially for OS X)
+# and would like to share, please post an issue on the GitHub tracker and we
+# can get them added to this file as references.
+#
+#
+# Mailcap 101
+# - The first entry with a matching MIME type will be executed, * is a wildcard
+# - %s will be replaced with the image or video url
+# - Add ``test=test -n "$DISPLAY"`` if your command opens a new window
+# - Add ``needsterminal`` for commands that use the terminal
+# - Add ``copiousoutput`` for commands that dump text to stdout
+
+###############################################################################
+# Commands below this point will open media in a separate window without
+# pausing execution of RTV.
+###############################################################################
+
+# Feh is a simple and effective image viewer
+# Note that rtv returns a list of urls for imgur albums, so we don't put quotes
+# around the `%s`
+image/x-imgur-album; feh -g 640x480 -. %s; test=test -n "$DISPLAY"
+image/gif; mpv '%s' --autofit=640x480 --loop=inf; test=test -n "$DISPLAY"
+image/*; feh -g 640x480 -. '%s'; test=test -n "$DISPLAY"
+
+# Youtube videos are assigned a custom mime-type, which can be streamed with
+# vlc or youtube-dl.
+#video/x-youtube; vlc '%s' --width 640 --height 480; test=test -n "$DISPLAY"
+video/x-youtube; mpv --ytdl-format=bestvideo+bestaudio/best '%s' --autofit=640x480; test=test -n "$DISPLAY"
+
+# Mpv is a simple and effective video streamer
+video/*; mpv '%s' --autofit=640x480 --loop=inf; test=test -n "$DISPLAY"
+
+###############################################################################
+# Commands below this point will attempt to display media directly in the
+# terminal when a desktop is not available (e.g. inside of an SSH session)
+###############################################################################
+
+# View images directly in your terminal with iTerm2
+# curl -L https://iterm2.com/misc/install_shell_integration_and_utilities.sh | bash
+# image/*; bash -c '[[ "%s" == http* ]] && (curl -s %s | ~/.iterm2/imgcat) || ~/.iterm2/imgcat %s' && read -n 1; needsterminal
+
+# View true images in the terminal, supported by rxvt-unicode, xterm and st
+# Requires the w3m-img package
+# image/*; w3m -o 'ext_image_viewer=off' '%s'; needsterminal
+
+# Don't have a solution for albums yet
+#image/x-imgur-album; echo
+
+# 256 color images using half-width unicode characters
+# Much higher quality that img2txt, but must be built from source
+# https://github.com/rossy/img2xterm
+#image/*; curl -s '%s' | convert -resize 80x80 - jpg:/tmp/rtv.jpg && img2xterm /tmp/rtv.jpg; needsterminal; copiousoutput
+
+# Display images in classic ascii using img2txt and lib-caca
+#image/*; curl -s '%s' | convert - jpg:/tmp/rtv.jpg && img2txt -f utf8 /tmp/rtv.jpg; needsterminal; copiousoutput
+
+# Full motion videos - requires a framebuffer to view
+#video/x-youtube; mpv -vo drm -quiet '%s'; needsterminal
+#video/*; mpv -vo drm -quiet '%s'; needsterminal
+
+# Ascii videos
+# video/x-youtube; youtube-dl -q -o - '%s' | mplayer -cache 8192 -vo caca -quiet -; needsterminal
+# video/*; wget '%s' -O - | mplayer -cache 8192 -vo caca -quiet -; needsterminal
diff --git a/mutt/.mutt/muttrc b/mutt/.mutt/muttrc
@@ -24,7 +24,7 @@ set header_cache = "~/.mutt/cache/headers"
set message_cachedir = "~/.mutt/cache/"
set certificate_file = "~/.mutt/certificates"
set mbox_type = Maildir
-set folder = "~/lib/doc/email/pyratebeard"
+set folder = "~/lib/documents/email/pyratebeard"
set spoolfile = +INBOX
set record = "~/.mutt/sent"
mailboxes = =INBOX
@@ -32,9 +32,13 @@ set mail_check = 120
# colours
color normal default default
-color indicator cyan black
+color indicator white magenta
color tree default default
color status white black
+color index white color8 "~T"
+color index color10 default "~U"
+color index red black "~D"
+color index color5 default "~F"
# pgp
source "~/.mutt/gpg.rc"
@@ -58,8 +62,10 @@ set sort_aux=date-received
unset markers
# handling for multi-part and html messages
+set mailcap_path = ~/.mailcap"
auto_view text/html
-alternative_order text/plain text/html
+alternative_order text/html text/plain
+set display_filter = "~/bin/mailfmt"
# sidebar
set sidebar_visible = no
diff --git a/tuir/.mailcap b/tuir/.mailcap
@@ -1,70 +0,0 @@
-# Example mailcap file for Reddit Terminal Viewer
-# https://github.com/michael-lazar/rtv/
-#
-# Copy the contents of this file to {HOME}/.mailcap, or point to it using $MAILCAPS
-# Then launch RTV using the --enable-media flag. All shell commands defined in
-# this file depend on external programs that must be installed on your system.
-#
-# HELP REQUESTED! If you come up with your own commands (especially for OS X)
-# and would like to share, please post an issue on the GitHub tracker and we
-# can get them added to this file as references.
-#
-#
-# Mailcap 101
-# - The first entry with a matching MIME type will be executed, * is a wildcard
-# - %s will be replaced with the image or video url
-# - Add ``test=test -n "$DISPLAY"`` if your command opens a new window
-# - Add ``needsterminal`` for commands that use the terminal
-# - Add ``copiousoutput`` for commands that dump text to stdout
-
-###############################################################################
-# Commands below this point will open media in a separate window without
-# pausing execution of RTV.
-###############################################################################
-
-# Feh is a simple and effective image viewer
-# Note that rtv returns a list of urls for imgur albums, so we don't put quotes
-# around the `%s`
-image/x-imgur-album; feh -g 640x480 -. %s; test=test -n "$DISPLAY"
-image/gif; mpv '%s' --autofit=640x480 --loop=inf; test=test -n "$DISPLAY"
-image/*; feh -g 640x480 -. '%s'; test=test -n "$DISPLAY"
-
-# Youtube videos are assigned a custom mime-type, which can be streamed with
-# vlc or youtube-dl.
-#video/x-youtube; vlc '%s' --width 640 --height 480; test=test -n "$DISPLAY"
-video/x-youtube; mpv --ytdl-format=bestvideo+bestaudio/best '%s' --autofit=640x480; test=test -n "$DISPLAY"
-
-# Mpv is a simple and effective video streamer
-video/*; mpv '%s' --autofit=640x480 --loop=inf; test=test -n "$DISPLAY"
-
-###############################################################################
-# Commands below this point will attempt to display media directly in the
-# terminal when a desktop is not available (e.g. inside of an SSH session)
-###############################################################################
-
-# View images directly in your terminal with iTerm2
-# curl -L https://iterm2.com/misc/install_shell_integration_and_utilities.sh | bash
-# image/*; bash -c '[[ "%s" == http* ]] && (curl -s %s | ~/.iterm2/imgcat) || ~/.iterm2/imgcat %s' && read -n 1; needsterminal
-
-# View true images in the terminal, supported by rxvt-unicode, xterm and st
-# Requires the w3m-img package
-# image/*; w3m -o 'ext_image_viewer=off' '%s'; needsterminal
-
-# Don't have a solution for albums yet
-#image/x-imgur-album; echo
-
-# 256 color images using half-width unicode characters
-# Much higher quality that img2txt, but must be built from source
-# https://github.com/rossy/img2xterm
-#image/*; curl -s '%s' | convert -resize 80x80 - jpg:/tmp/rtv.jpg && img2xterm /tmp/rtv.jpg; needsterminal; copiousoutput
-
-# Display images in classic ascii using img2txt and lib-caca
-#image/*; curl -s '%s' | convert - jpg:/tmp/rtv.jpg && img2txt -f utf8 /tmp/rtv.jpg; needsterminal; copiousoutput
-
-# Full motion videos - requires a framebuffer to view
-#video/x-youtube; mpv -vo drm -quiet '%s'; needsterminal
-#video/*; mpv -vo drm -quiet '%s'; needsterminal
-
-# Ascii videos
-# video/x-youtube; youtube-dl -q -o - '%s' | mplayer -cache 8192 -vo caca -quiet -; needsterminal
-# video/*; wget '%s' -O - | mplayer -cache 8192 -vo caca -quiet -; needsterminal