dotfiles

custom dotfiles
git clone git://git.pyratebeard.net/dotfiles.git
Log | Files | Refs | README

commit 65729552d68f21a9ad39018190a20dffacc96c1f
parent a8114f6307e38b8542793d3327c966628873b8ce
Author: pyratebeard <root@pyratebeard.net>
Date:   Thu, 25 Feb 2021 15:44:17 +0000

updated mailcap. htmldump for html mails

Diffstat:
Abin/bin/htmldump | 21+++++++++++++++++++++
Mmutt/.mailcap | 10++++++++--
2 files changed, 29 insertions(+), 2 deletions(-)

diff --git a/bin/bin/htmldump b/bin/bin/htmldump @@ -0,0 +1,21 @@ +#!/bin/sh + +usage() { + echo "usage: $(basename $0) [-c charset] file" >&2 +} + +while getopts 'c:h' OPT; do + case $OPT in + c) charset=$OPTARG ;; + h) usage; exit 0 ;; + *) usage; exit 1 ;; + esac +done + +shift $((OPTIND -1)) + +[ -z "$charset" ] && charset="$(file -i $1 | sed 's/.* charset=//')" +iconv -f $charset -t utf-8 $1 \ + | webdump -al \ + | sed 'y/ / /;s/^\s*$//' \ + | cat -s diff --git a/mutt/.mailcap b/mutt/.mailcap @@ -26,8 +26,10 @@ # 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" +#image/gif; mpv '%s' --autofit=640x480 --loop=inf; test=test -n "$DISPLAY" +image/gif; webimg -a '%s' ; test=test -n "$DISPLAY" +image/*; webimg '%s' ; 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. @@ -68,3 +70,7 @@ video/*; mpv '%s' --autofit=640x480 --loop=inf; test=test -n "$DISPLAY" # 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 +#text/html; /usr/bin/firefox %s >/dev/null 2>&1; needsterminal +#text/html; /usr/bin/w3m -I %{charset} -T text/html; copiusoutput +#text/html; /usr/bin/lynx -dump -force_html -width=96 '%s'; needsterminal; copiusoutput +text/html; /home/pyratebeard/bin/htmldump -c %{charset} '%s'; copiousoutput