💾 Archived View for ait.place › dot › tuir › .config › tuir › mailcap.txt captured on 2022-06-03 at 22:54:37.

View Raw

More Information

⬅️ Previous capture (2021-12-03)

🚧 View Differences

-=-=-=-=-=-=-

# Example mailcap file for Terminal UI for Reddit
# https://gitlab.com/ajak/tuir/
#
# Copy the contents of this file to {HOME}/.mailcap, or point to it using $MAILCAPS
# Then launch TUIR using the --enable-media flag. All shell commands defined in
# this file depend on external programs that must be installed on your system.
#
#                              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

image/gif; mpv '%s'  --loop=inf &; test=test -n '$DISPLAY'
#image/*; curl -s '%s' > /tmp/tuirimg && sxiv /tmp/tuirimg &; test=test -n '$DISPLAY'
image/*; feh '%s' &; test=test -n '$DISPLAY'


text/*; linkhandler '%s'; test=test -n '$DISPLAY'
Application/octet-stream; linkhandler '%s'; test=test -n '$DISPLAY'


video/x-youtube; mpv --ytdl-format=bestvideo+bestaudio/best '%s' &; test=test -n '$DISPLAY'
video/*; mpv '%s' --loop=inf &; test=test -n '$DISPLAY'

# 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/tuir.jpg && img2xterm /tmp/tuir.jpg; needsterminal; copiousoutput

# Display images in classic ascii using img2txt and lib-caca
image/*; curl -s '%s' | convert - jpg:/tmp/tuir.jpg && img2txt -f utf8 /tmp/tuir.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/*; mpv -cache 8192 -vo caca -quiet '%s'; needsterminal