urlview(1)

πŸ’– urlview β€” URL extractor/launcher πŸ’–

okay bestie, gather round, because urlview is one of those tiny little tools that is lowkey carrying your whole terminal workflow and nobody ever talks about it. it's from the General Commands Manual, section 1, and it is, and I quote, a URL extractor/launcher. that's the whole NAME. short king behavior. πŸ‘‘


✨ SYNOPSIS ✨

urlview filename [ filename ... ]

like. you feed it files. it does the rest. periodt. πŸ’…


🌸 DESCRIPTION 🌸

so urlview is a screen oriented program β€” meaning it takes over your terminal and gives you a whole lil interactive menu, very main character β€” that goes through text files, extracts the URLs out of them, and then shows you a menu where you can pick one and launch a command to view that specific item.

it's giving "I found 47 links in this email and I am NOT copy-pasting them one by one." iconic. πŸ¦‹


πŸŽ€ CONFIGURATION πŸŽ€

on startup, urlview tries to read ~/.urlview. if that file doesn't exist, it falls back to the system wide file at /etc/urlview.conf. so it checks your personal vibe first, then the group chat default. 🫢

the page says there are two configuration commands (order does not matter) β€” and then the list keeps going, so buckle up, we're reading all of them:

  • REGEXP regexp β€” urlview uses a regular expression to pull URLs out of the text files you gave it. \r, \t, \n and \f are all converted to their normal printf(3) meanings. the default REGEXP is:
(((http|https|ftp|gopher)|mailto):(//)?[^ <>"\t]*|(www|ftp)[0-9]?\.[-a-z0-9.]+)[^ .,;\t\n\r<">\):]?[^, <>"\t]*[^ .,;\t\n\r<">\):]
  • COMMAND command β€” if your specified command contains a %s, that gets substituted with the URL that was requested. otherwise, the URL is just appended to the COMMAND string. the default COMMAND is:
/usr/bin/url_handler.sh
⚠️ note, and this one matters: you should never put single quotes around the %s. urlview does this for you, and it also makes sure that single quotes eventually showing up inside the URL are handled properly. (and note that this shouldn't even happen with the default regular expression, because that regexp explicitly excludes single quotes.) so like… don't help. you're not helping. 😭
  • WRAP choice β€” enable or disable URL wrapping. valid values for choice are: yes, no (case insensitive). if this option isn't supplied at all, the default behaviour is to disable wrapping. no wrapping unless you say so, fr fr. πŸ™ˆ
  • QUITONLAUNCH β€” this one will cause urlview to quit after you launch a URL. no lingering, no small talk, in and out. πŸ’€

πŸ“ FILES πŸ“

  • /etc/urlview.conf β€” the system-wide urlview configuration file 🌈
  • ~/.urlview β€” your urlview configuration file πŸ’œ

🌟 ENVIRONMENT 🌟

if the environment variable BROWSER is set to a browser command, or to a colon-delimited list of commands to try, then that specified browser is what gets used. %s gets replaced with the quoted url to view. and if %s is not part of a command, the url is simply appended to the command.

but here's the plot twist πŸ‘‘ β€” the BROWSER environment variable is honored only if the rc-file doesn't contain the COMMAND option. and the rc-file provided by the Debian package does contain a COMMAND option. so if you're on Debian and you're like "why is my BROWSER being ignored 😭" β€” that's why. mystery solved, you're welcome.


πŸ¦‹ SEE ALSO πŸ¦‹

printf(3), regcomp(3), regex(7), environ(7)


⭐ AUTHOR ⭐

  • Michael Elkins <me@sigpipe.org>
  • Modified for Debian by Luis Francisco Gonzalez <luisgh@debian.org> and Emanuele Rocca <ema@debian.org>.
  • Modified for SuSE by Dr. Werner Fink <werner@suse.de> and Stepan Kasal <kasal@suse.cz>.
  • Changes put together by Thomas Roessler <roessler@does-not-exist.org>.

and that's the whole page bestie πŸŽ€βœ¨ the urlview(1) entry, straight out of the General Commands Manual β€” go extract some URLs, you absolute legend. no cap, you ate. πŸ’…πŸ‘‘πŸ«Ά

πŸ“¦ where this page comes from