Offpunk 1.3 : Making it Easy and Useful
by Ploum on 2022-04-02
Offpunk has a new home, update your git repository:
Why I’m doing Offpunk
Browsing through the command line protects me from sensory overload. It makes me less angry, less anxious. It also makes me a better reader. Do the experience : construct a small book where each page is of a completely different format from the others. Different fonts, different colours, pictures mixed with it. And print exactly the same content in a boring black and white. Which one is the more readable? Which one will allow you to get the information of the text?
Experimenting it is quite eye opening. But, although I’m praising words, actions are (sometimes) better than words. What am I doing to promote this?
I try to make a command line browser that is relatively easy and useful. At first, it was only a small tool for myself but what if people trying it realize they could handle 20%, 50% or 80% of their web browsing in the command line instead of the 1% they usually did?
What if I could help those users who started to use Linux but are still afraid of the terminal? If you are happy with Links, W3M or Amfora (which is awesome), keep them. But if you never really experienced the command line and are curious, give Offpunk a try.
Targeting those users makes decisions a bit clearer. Offpunk should be more intuitive and easier to install.
What’s new in 1.3
That’s why, based on feedback from users, Offpunk will now fetch pictures of webpages before displaying them. It makes the initial connection slower but it ensures that, when using Offpunk online, you immediately get the full experience (this is configurable with "set download_images_first"). I highly recommend using Kitty as your terminal when using Offpunk.
Some dependencies were also removed. No more python-editor as it was not always picking a sane default.(if $EDITOR or $VARIABLE is not set in your shell, simply do "set editor MYEDITOR" in Offpunk, where MYEDITOR is your editor of choice. If the previous sentence seems unintelligible, don’t bother, Offpunk will tell you the command if needed). Dependency to python-magic has also been dropped in 1.3 in favour of directly using "file", which is a standard Unix tool and should be on most systems. Most python bindings seem to be simple wrappers around existing tools so why bother with all that pip craziness and dependency hell when you can just use the tool directly? I like Python but the python ecosystem is really in a bad shape.
I’m thinking to directly integrate some special handling for known websites (like allowing to directly download a video from a Youtube page. Unfortunately, I don’t have much motivation as I hate watching videos).
One other area I’m exploring is making python-readability optional. You can already see what it would be without it by doing "view full" (or "v full") on a webpage. I feel that python-readability really improve a lot the experience. But the library seems not to be actively maintained anymore and to be hard to install on some systems. What do you think?
Dependencies and packaging
With dropped dependencies, on Debian and Ubuntu, installing all dependencies is as easy as:
sudo apt install file xdg-utils xsel ripgrep chafa timg python3-cryptography python3-requests python3-feedparser python3-bs4 python3-readability python3-pil python3-setproctitle
In Debian testing, you can even drop python3-pil and timg as chafa 1.10 is available. This also enable animated gifs in Offpunk. Not to be completely deprived from the webesque sensory overload.
If you are using Offpunk on another system, I would be very happy to receive the command needed to install all dependencies. I will add it to the documentation. Toby Kurien contributed a requirements.txt to help you install dependencies with pip while Iván Ruvalcaba did all the work to make the first Offpunk debian package. Nice! (I’m still unsure how to distribute it and keep it up to date, something I should clarify with Iván).
With the help of Pelle Nilsson, I’ve also tried to make Offpunk work with older python version. We are currently trying to make it work on Ubuntu 18.04 with Python 3.6. Any testing/bug report is warmly welcome.
Last but not least, while I keep Offpunk on tildegit, that I like, I’m now making notabug.org the official Offpunk development platform. The reason is that not many people have accounts on tildegit, which is restricted. If I want bug reports, I should be where people can freely create accounts. Maybe I should do a proper capsule/website for Offpunk. Too many stuff to do…
I’m proud that Offpunk is a single python file with quite minimal dependencies (in fact, it works as a Gemini/Gopher client without any dependency at all). But let’s face it: this file is a huge spaghetti blob. A fairly-well-structured spaghetti but still spaghetti. As I’m fond of the UNIX philosophy, I plan to rewrite the whole stuff as a set of 3 or 4 independent tools that would be combined to create Offpunk. That would allow other projects to use Offpunk back end without the front end (think an offline-first graphical browser) and, if needed, to rewrite some parts using something else than Python. But, at the same time, I’ve a currently working prototype that allows Offpunk to read Maildir folders (displaying my emails in Offpunk). I might be too optimistic…