The only document-focused mailcap style utility with a wombat mascot.
The only cli document viewer with a wombat in a sombrero as a mascot.
Very simply, this is a document viewer type version that plays a similar role as mailcap and other such utilities. Its focus is on displaying documents quickly in a terminal (or a popup terminal).
Inspiration taken from
mutt.octet.filter for how to best match mimetypes.
Why should you use this instead of another mailcap type solution?
As written with the full helper list, it is set up to render Word (DOC & DOCX), Excel (XLS and XLSX), Open/LibreOffice (ODS/ODT), RTF, PDF, markdown, JSON, and HTML and will pretty much gladly take any text file (XML, etc) and colorize it.
If it runs across an undefined filetype, it can pass it on to any other mailcap style program, and is set up to use my fork of gotbletu’s URLPortal by default.
It can call and decorate its own xterm window if called from a GUI file manager.
With TDAB installed, when called in TMUX it will automatically show the document in a new zoomed pane.
It has a wombat in a sombrero as a mascot.
Why should you not use this script?
While there’s a few “fallback” checks if helpers aren’t installed, if you want to use different helpers to render and display things, you’ll have to edit the script directly. Which is an issue with any mailcap style solution, so…
You’re happy with what you have. Hey, that’s cool!
This project is licensed under the MIT License. For the full license, see
This includes all of the helpers as well; the “core” first four are for the script itself and are probably already installed on your system. Installing all the helpers is obviously not necessary; however, doing so will result in everything working out of the box.
The following can be installed on Debian Buster or Bullseye (and probably Ubuntu) by typing
sudo apt update;sudo apt-get install fzf awk sed file mysql sqlite3 pandoc lynx wv unrtf pdftotext bat dtrx csvtool
These can be installed (if you have python and pip installed, naturally) by typing:
sudo pip3 install -r requirements.txt
sudo pip3 install git+https://github.com/wustho/epy
These are really optional, but are nice:
Clone or download the repo. If you downloaded it, unarchive it into a
directory, then make a symlink into your path. Place
lynx.lss in `$HOME/.lynx
showdocs.sh to determine if the “helpers” I use are the ones you wish
The most basic usage is to invoke
To invoke the MySQL viewer, the command should be:
showdocs.sh mysql [MYSQL USERNAME] [MYSQL PASSWORD]
If you invoke it under tmux and have TDAB
devour script will automatically be invoked, creating a new
maximized pane with your document in it.
The old way of calling this script from a GUI viewer (such as Double Commander which spawned a new window was something like:
xfce4-terminal --hide-menubar --geometry=80x43 -e "/home/steven/bin/showdocs %f"
That will still work, but you can simplify (and enhance) the experience by using the -g switch, making the command something like this:
/home/steven/bin/showdocs -g %f
Not only will it launch a new xterm, but if you have
it will decorate the window with the script’s icon and name.
If you wish to colorize your output - particularly of sourcecode - you should
.lessfilter. There’s a good tutorial at Miskatonic.org.
If it cannot find a match, and you have the URLPortal script from newsbeuter-dangerzone in $PATH - see this file if you don’t care about the rest of the repository - it will then hand everything off to that program. In that way, it can handle a lot of other datatypes as well without getting too complicated. Feel free to substitute your own “mailcap” style solution instead.
Steven Saus injects people with radioactivity for his day job, but only to serve the forces of good.