zaread is a simple posix shell script that uses zathura pdf/epub viewer to act as a lightweight document/ebook readonly reader
If you are opening a pdf or an epub it doesn't do anything more than launch zathura. If the file is a Microsoft Office document, or a "mobi" ebook, or another supported file, zaread converts it into pdf and put it into a cache. The next time you'll open the file it will take it from the cache. If you edit a document after having opened it with zaread, the next time you will open it zaread will recognize that the file differs from cache and a new converted file will be created.
- DJVU
- EPUB
- OOXML documents (docx, xlsx, pptx)
- Old MS Office documents (doc, xls, ppt)
- MOBI
- CSV
- Markdown (md)
- RTF
- Typst (typ)
- Unfortunately, we can't have libreoffice command line tools without getting the whole suite, and I don't know any other options to convert Office files on Linux...
- Same about MOBI files (you need calibre to have a converter)
- md2pdf has some python dependencies but it's (imho) a better option than first implementation with pandoc, which requested the whole texlive suite to work
Yes, but it will not work with its target file formats
Yes, you just have to change $reader variable with your chosen viewer
At work I often need to open doc, docx, ppt, pptx files in read only mode. I hate libreoffice interface with all those buttons (useless if I just need to view file content), and I hate presentation mode, because it forces fullscreen mode and I want the freedom to open Office files in a "normal" window, considering that I have a tiling wm.
- Install zathura (and libreoffice, calibre and md2pdf as optional dependencies)
- Then get
zaread
git clone https://github.com/paoloap/zaread
cd zaread
DEST=$HOME/.local make install
# or
sudo make install
Aaaand that's it.
- Rewriting code I forgot to put some double quote, so if paths had spaces in them it didn't work. Thanks to hassty!
- If you alternately opened two files with the same name (and potentially different extension) zaread didn't recognize they were separate files and kept re-converting them. Now the cache file names directly contain their checksum and their size in their name, so that every unique file has its converted version.
- General code refactoring
I'm so sorry guys, I just found out today that this script in the past few years has been adopted by many people and even ended up into AUR repos. If someone wants to contribute, i.e. the ones that opened the issues and the pull requests, he's obviously welcome! Btw just merged all the pull requests
- Now you can just clone the repo and do "sudo make install"
- Added .md files support (depends on pandoc)
- Now the cache directory is ~/.cache/zaread
- Fixed ebook conversion
Thanks to iulandita, TheOPtimal, millenito and mvrozanti for their help!
- Cache auto-cleaning policies
- Add more extensions support (xlsb, xlsm...)
Feel free to use and edit :)