Re: Console HTML view with picture using W3M or other

2021-08-01 Thread D.J.J. Ring, Jr.
Tavis,

I only find /etc/skel/.Xresources for a .Xresources file, where do I put
this file if I want to enable sixel support for sixels as you suggested?

> I think you just need
> something like this in .Xresources to enable it in xterm:
>
> XTerm*decTerminalID: vt382
>

Best wishes,
David


On Sun, Aug 1, 2021 at 6:58 PM Tavis Ormandy  wrote:

> On 2021-08-01, Patrick Shanahan wrote:
>
> Not exactly what was asked, but I use this mailcap to view image
> attachments:
>
> image/png; img2sixel -- %s | less -r; nametemplate=%s.png; needsterminal
>
> It uses the sixel support in xterm (or any other terminal that supports
> sixels) to display images in the terminal. I think you just need
> something like this in .Xresources to enable it in xterm:
>
> XTerm*decTerminalID: vt382
>
> Tavis.
>
>


Re: Console HTML view with picture using W3M or other

2021-08-01 Thread David J. J. Ring, Jr.
Hello Tavis,

I love that name! It reminds me of beautiful music, or is it the Ormandy last 
name.

I cannot find an "av" package what Jude suggested.

You, Tavis, mentioned adding to mailcap this line:

image/png; img2sixel -- %s | less -r; nametemplate=%s.png; needsterminal

I'm guessing - and I realize that's gotten me into the deep fryer more than 
once... that you can make more lines in mailcap based on that line for 
different picture formats -- stop me if you hear hot oil bubbling and David 
screaming...

image/jpg; img2sixel -- %s | less -r; nametemplate=%s.png; needsterminal
image/jpeg; img2sixel -- %s | less -r; nametemplate=%s.png; needsterminal
image/gif; img2sixel -- %s | less -r; nametemplate=%s.png; needsterminal

I find a package called "libsixel" in Slackware and I'm installing that.

Thanks and say "Hello to Eugene Ormandy" he was a great favorite of a friend of 
mine who was born in Budapest.

Best regards,
David Ring


  Tavis Ormandy wrote:
Sun, Aug 01, 2021 at 10:58:37PM -

> On 2021-08-01, Patrick Shanahan wrote:
> > * Jude DaShiell  [07-31-21 23:34]:
> >> If memory serves, w3m can use av package if installed to allow it to view
> >> pictures.  I've only read about this never having been able to look at
> >> pictures.
> >> On Sat, 31 Jul 2021, D.J.J. Ring, Jr. wrote:
> >> > Has anyone succesfully configured mutt to give a roughly equivalent
> >> > view of html emails using w3m or other
> >> > browser in text console with direct-fb or other?
> > w3m is configuragle to display images, "auto_image=TRUE"
> 
> Not exactly what was asked, but I use this mailcap to view image
> attachments:
> 
> image/png; img2sixel -- %s | less -r; nametemplate=%s.png; needsterminal
> 
> It uses the sixel support in xterm (or any other terminal that supports
> sixels) to display images in the terminal. I think you just need
> something like this in .Xresources to enable it in xterm:
> 
> XTerm*decTerminalID: vt382
> 
> Tavis.
> 
> -- 
>  _o)$ lynx lock.cmpxchg8b.com
>  /\\  _o)  _o)  $ finger tav...@sdf.org
> _\_V _( ) _( )  @taviso
> 


signature.asc
Description: PGP signature


Re: Console HTML view with picture using W3M or other

2021-08-01 Thread David Champion
I do roughly the same, though I use a wrapper script that lets me choose an
inline (sixel) or external viewer. Sometimes I want to view the image while
walking mutt on to another task, and in that case the wrapper script
handles the lifecycle of the temporary file thus needed.

mailcap:
# -i or -e, or neither for a choice
image/*; mutt-view-image -i %s

mutt-view-image:
#!/bin/sh

case "$1" in
-i) mode=inline; shift;;
-e) mode=external; shift;;
*)  : ;;
esac

if [ "$mode" = "" ]; then
normal=$(stty -g)
printf "Do you want to view (i)nline or (e)xternal? "
trap "stty $normal" 1 2 3 15
stty raw -echo

c=$(dd if=/dev/stdin bs=1 count=1 2>/dev/null)
stty $normal
echo

pause=false
case "$c" in
i*) mode=inline;;
e*) mode=external;;
esac
fi

if [ "$mode" = "inline" ]; then
view="img2sixel %s 2>/dev/null"
pause=true

elif [ "$mode" = "external" ]; then
view="xopen %s; sleep 10"
fi

xopen () {
# External open
d=$(dirname "$1")
f=$(basename "$1")
fn="$d/async_$f"
ln "$1" "$fn"
at now + 5 minutes &1
EOF
# This opens on Linux or MacOS
(xdg-open "$fn" || open "$fn") 2>/dev/null
}

cmd=$(printf "$view" "$1")
eval $cmd
if $pause; then
restore=$(stty -g)
trap "stty $restore" 1 2 3 15
echo
echo "Press any key to continue..."
stty raw -echo
dd if=/dev/stdin bs=1 count=1 of=/dev/null
stty $restore
fi

On Sun, Aug 1, 2021 at 3:58 PM Tavis Ormandy  wrote:

> On 2021-08-01, Patrick Shanahan wrote:
> > * Jude DaShiell  [07-31-21 23:34]:
> >> If memory serves, w3m can use av package if installed to allow it to
> view
> >> pictures.  I've only read about this never having been able to look at
> >> pictures.
> >> On Sat, 31 Jul 2021, D.J.J. Ring, Jr. wrote:
> >> > Has anyone succesfully configured mutt to give a roughly equivalent
> >> > view of html emails using w3m or other
> >> > browser in text console with direct-fb or other?
> > w3m is configuragle to display images, "auto_image=TRUE"
>
> Not exactly what was asked, but I use this mailcap to view image
> attachments:
>
> image/png; img2sixel -- %s | less -r; nametemplate=%s.png; needsterminal
>
> It uses the sixel support in xterm (or any other terminal that supports
> sixels) to display images in the terminal. I think you just need
> something like this in .Xresources to enable it in xterm:
>
> XTerm*decTerminalID: vt382
>
> Tavis.
>
> --
>  _o)$ lynx lock.cmpxchg8b.com
>  /\\  _o)  _o)  $ finger tav...@sdf.org
> _\_V _( ) _( )  @taviso
>
>


Re: Console HTML view with picture using W3M or other

2021-08-01 Thread Tavis Ormandy
On 2021-08-01, Patrick Shanahan wrote:
> * Jude DaShiell  [07-31-21 23:34]:
>> If memory serves, w3m can use av package if installed to allow it to view
>> pictures.  I've only read about this never having been able to look at
>> pictures.
>> On Sat, 31 Jul 2021, D.J.J. Ring, Jr. wrote:
>> > Has anyone succesfully configured mutt to give a roughly equivalent
>> > view of html emails using w3m or other
>> > browser in text console with direct-fb or other?
> w3m is configuragle to display images, "auto_image=TRUE"

Not exactly what was asked, but I use this mailcap to view image
attachments:

image/png; img2sixel -- %s | less -r; nametemplate=%s.png; needsterminal

It uses the sixel support in xterm (or any other terminal that supports
sixels) to display images in the terminal. I think you just need
something like this in .Xresources to enable it in xterm:

XTerm*decTerminalID: vt382

Tavis.

-- 
 _o)$ lynx lock.cmpxchg8b.com
 /\\  _o)  _o)  $ finger tav...@sdf.org
_\_V _( ) _( )  @taviso



Re: Console HTML view with picture using W3M or other

2021-08-01 Thread Patrick Shanahan
* Jude DaShiell  [07-31-21 23:34]:
> If memory serves, w3m can use av package if installed to allow it to view
> pictures.  I've only read about this never having been able to look at
> pictures.
> 
> 
> On Sat, 31 Jul 2021, D.J.J. Ring, Jr. wrote:
> 
> > Has anyone succesfully configured mutt to give a roughly equivalent
> > view of html emails using w3m or other
> > browser in text console with direct-fb or other?
> >
> > If so, is there a ~/.config/mailcap or muttrc file or both that anyone
> > would care to share or point me to?


w3m is configuragle to display images, "auto_image=TRUE"

-- 
(paka)Patrick Shanahan   Plainfield, Indiana, USA  @ptilopteri
http://en.opensuse.orgopenSUSE Community Memberfacebook/ptilopteri
Photos: http://wahoo.no-ip.org/piwigo   paka @ IRCnet freenode


Re: Console HTML view with picture using W3M or other

2021-08-01 Thread meine
On Sat, Jul 31, 2021 at 08:10:04PM -0400, D.J.J. Ring, Jr. wrote:
> Has anyone succesfully configured mutt to give a roughly equivalent
> view of html emails using w3m or other
> browser in text console with direct-fb or other?

Below are my settings. I put viewing the text file first, and access the
html manually when for some reason it doesn't display the text. Access
of the html part through `v` and then choose the html version. I use
lynx to view email. My settings are for use in both CLI (TTY, bare bone)
and GUI (xterm in a console window).

You could need an extra line in your mailcap to view emails made on an
iPhone, but I don't have that setting here at hand.

In your muttrc

# viewers defined in ~/.mutt/mailcap
set mailcap_path = ~/.mutt/mailcap
auto_view text/html
alternative_order text/plain text/html

In your mailcap

# HTML
text/html;  lynx --force_html --dump %s; copiousoutput; 
 nametemplate=%s.html
text/*; view

Kind regards,

//meine