diff options
Diffstat (limited to 'articles/2025/Lynx,-Gopher,-and-video-files.html')
| -rwxr-xr-x | articles/2025/Lynx,-Gopher,-and-video-files.html | 102 |
1 files changed, 102 insertions, 0 deletions
diff --git a/articles/2025/Lynx,-Gopher,-and-video-files.html b/articles/2025/Lynx,-Gopher,-and-video-files.html new file mode 100755 index 0000000..6288414 --- /dev/null +++ b/articles/2025/Lynx,-Gopher,-and-video-files.html @@ -0,0 +1,102 @@ +<!doctype html> +<html lang="EN"> + <head> + <meta charset="utf-8"> + <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" href="/style.css"> + <title>Lynx, Gopher, and video files</title> + </head> + <body> + <header> + <h1>Bloggings</h1> + <a href="/index.php">Back</a> + + </header> + +<main> +<article> +<h2>Lynx, Gopher, and video files</h2> +<h3>2025-09-21</h3> +<h4>Getting Lynx to open video files</h4> + +<p>I've been using Lynx as a Gopher browser on Artix Linux, +and I like it a lot as it renders cleanly, has logical +keybindings, and enables following html links.</p> +<p>But...</p> +<p>Trying to open video files with an external application +wasn't working. Luckily on one test I saw an error +concerning "mpeg_play".</p> + +<p>The only mention of this file is as a VIEWER entry in +lynx.cfg. But changing it to something else has no effect +at all.</p> + +<p>Somewhere in lynx, mpeg_play is hardcoded. 🤔. Checking the Lynx source code, I found it in HTInit.c</p> +<p>Why short circuit the config file this way? Anyway, I wrote a bash script named mpeg_play:</p> + +<p> +#!/usr/bin/env bash<br> +/usr/bin/mpv --title="Mpv" >/dev/null 2>&1 $1 +</p> + +<p>chmod +x mpeg_play and put it in my PATH</p> + +<p>and it works!<br> +Lynx can now play media files in Gopher holes. +(Note the --title parameter is to get it to play nice with dwm).</p> + +<p>The question remains: why is this hard coded?</p> + +<p>As for mpeg_play, it appears in Linux mailcap +entries in the 90's and seems to have been bundled +in ximagetools.</p> + +<p>Mpeg_play appears to date back a long way as a UNIX application:</p> + +<p><a href="http://www.geom.uiuc.edu/software/mpeg_play">http://www.geom.uiuc.edu/software/mpeg_play</a></p> + +<h3>Update 2025-09-23</h3> + +<p>A little tweak made this script capable of opening playlists</h3> + +<p>----------</p> +<p> +#!/usr/bin/env bash<br> +# necessary for Lynx browser video files<br> +# chmod +x and place in your PATH<br> +<br> +# mpv can sometimes take a few seconds to open when streaming<br> +# so I use notification that it's happening<br> +<br> +dunstify -t 2000 -a "Video" -u low -i "media-playback-start-symbolic"\<br> + -h string:x-dunst-stack-tag:"Media" "MPV Launching" &<br> +<br> +# detect if playlist<br> +# Lynx uses an anonymous file in /tmp, so we can only<br> +# detect a file type by it's contents, not it's extension<br> +<br> +if [ "$(grep -c "EXT3MU" "$1")" -eq 1 ]; then<br> + # this is a playlist<br> + # I use dwm, the mpv options used here make it compatible<br> + mpv --geometry=1068x600 --ontop --idle=yes --force-window=yes\<br> + --playlist="$1" >/dev/null 2>&1 &<br> +else<br> + mpv --geometry=1068x600 --ontop --idle=yes --force-window=yes\<br> + "$1" >/dev/null 2>&1 &<br> +fi<br> +<br> +exit 0<br> +</p> +<p>----------</p> +<p>The latest version can be found at <a href="https://git.wittamore.fr">git.wittamore.fr</a></p> + + </article> +</main> +<footer> + + <p> </p> + + <p>§</p> + </footer> +</body> +</html> |
