💾 Archived View for tobykurien.com › articles › 2022-01-11-distraction-free-computing.gmi captured on 2024-08-18 at 16:53:03. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-04-19)

-=-=-=-=-=-=-

Experiments with distraction-free computing

I've recently been stuck in looping thoughts around offline computing, permacomputing, and the idea that if I just gave up using a web browser, I might be able to get away with a tiny, low-powered pocket computer that could boot up in a few seconds and run for days on a small battery. I get a huge kick out of making tiny gadgets to solve my problems so I spent way too much time thinking about what I could build around these ideas. I was particularly inspired by this article by Ploum (an essay that I've read multiple times in succession):

(HTTPS) The computer built to last 50 years

I went down many rabbit holes (and even a 100rabbits hole), and I enjoyed every minute of it! Anyway I thought I'd summarise some things I tried in the hope of breaking my looping thoughts.

Experiment 1: Text UI

I was intrigued by the idea that I could potentially replace my smartphone with a "cyberdeck" of sorts: some tiny Raspberry Pi powered terminal running only text-based apps. As outlined in some previous posts, I decided to try experimenting with a text UI based on Turbo Vision, so that it would work on a touch screen and I'd be able to use apps without necessarily having a keyboard attached.

I settled on using Jexer, despite being built in Java, as it is feature-rich and easy to code for. I also really like that Java apps don't have dependencies other than the JVM, making it easy to run anywhere. I first tried it on my laptop, and it works great! The Jexer JAR file is under 1Mb, and the Java runtime is about 35Mb, which seems reasonable. I especially liked the `xtwm` incarnation of Jexer that is an "Xterm Window Manager" giving you multiple terminal windows that can tile, with multiple "desktops", and widgets like a Calendar.

Next I ran Jexer in Termux on Android. This actually worked too, but the first real problem became obvious: UI scaling. The text is just too tiny, and so it's really difficult to click on things. I couldn't find a way to make the text bigger, and even if I had, the portrait aspect ratio would make it really hard to use. The font size is more of a Termux issue though, and I was encouraged by how easy it was to get Jexer working in Android.

Next I moved onto the Raspberry Pi. I wanted to see how fast I could go from connecting power, to a Jexer text UI appearing. I turned to Tiny Core Linux. The whole OS is only 55Mb and with a few simple boot optimizations, it boots from power-up to a usable command line in 8 seconds (I timed it). I installed Java 16 JDK, copied the Jexer JAR in, and had it running in no time. From power-up to Jexer UI interface takes on a Raspberry Pi 3A+ (off a slow 1Gb microSD card) 12 seconds, which feels fast enough. Using a 7" touch screen, the widgets were sized correctly, but on a smaller screen, I'm not sure how one would change the font size.

Jexer running on a Raspberry Pi

I couldn't get images to show (using sixel graphics) on any platform, with any terminal emulator I tried. I don't see this as an issue anyway, since the idea would be to send images to a framebuffer image viewer, and videos to `omxplayer`.

At this point I had something working, but my thoughts looped around to: what are you going to use it for? Is it an offline PDA (as has been discussed in Gemini a lot)? Am I going to be writing blogs or programming on it? Is it meant to be portable or used on a desk? Is it offline and sync'd, or always online? Hmmm...

Experiment 2: Offline PDA

I did a lot of digging around e-Ink displays, and perhaps I could get an m5paper which has a nice form factor, and I'm quite comfortable coding for the ESP32, which has very nice deep-sleep low-power modes, and look I found some GitHub projects with apps for the m5paper, and...

Then it hit me that I already have a great e-Ink device in the form of my Kindle 4, which I read on a lot. Could the Kindle be my "offline PDA"? This could work, at least for the consumption and contemplation side of things. If I can create "books" with my calendar, todo list, my notes/knowledge base which is in vimwiki, perhaps the week's weather report, then that'd be a great start. I could also then create books with other content I frequent (mostly from Gemini, like Antenna). I had previously used the Kindle browser with a Gemini proxy to read Gemini content on the Kindle, but I've since found that I enjoy it a lot more (and read a lot more of the content) when it's already compiled into a "book".

So that's exactly what I did. I created a script that outputs a simple text file. I piped in the output of `khal list`, `grep ~/vimwiki/todos.wiki`, etc. I then learned that I can turn the text file into an HTML file (but leave the extension as .txt) and the Kindle will render the HTML (with some limitations).

I then found an even nicer way of generating a book by turning the original text file into a markdown file, insert `<div style="page-break-before:always;"></div>` wherever I want a page break, then use `pandoc` to turn this into an epub (with table of contents), and finally use `ebook-convert` (installed with Calibre) to turn that into a mobi file. Sounds convoluted, but it's 2 lines in a script file and all I need to do is plug in my Kindle, run the script (which ejects the Kindle when done), then unplug the Kindle. Since this works so well, I started adding more and more things to the script, for example using `gemget` utility to get the latest Antenna feeds and turn it into a book. The best part is that I can use the left/right buttons to skip sections/articles.

(I see now there's an AntennaZINE, but it doesn't have all the content, just allowed ones)

You will note that this is not exactly a "PDA". For one, I can't input anything. This hasn't really been a problem for me, because I always carry a writing pad with me. While I'm reading, if I think of something, I write it down. If I complete a todo, I make note of it. Once I'm back at my desktop, I'll input the changes, and re-sync the Kindle.

One last tweak I found really useful is to disable the "screensaver" on the Kindle. I found an obsure blog outlining the method via a search. Once done, it allows me to leave my todo list on display forever, so that I can glance at it at any time, especially after a round of loopy thoughts.

For reference, here's a snippet of what the script looks like:

#!/bin/sh                                                        
DEVICE=/dev/sdb1
KINDLE=/media/toby/Kindle/documents                              
COLUMNS=40                                                       
DATE=`date +"%A, %F"`                                            
                                                                 
gio mount -d $DEVICE || echo "Already mounted"                 
                                                                 
DAILY=/tmp/daily.md                                              
echo "# $DATE\n" > $DAILY                                        
                                                                 
echo '\n<div style="page-break-before:always;"></div>' >> $DAILY 
echo "## Calendar\n" >> $DAILY                                   
echo '\n```\n' >> $DAILY                                         
khal list >> $DAILY                                              
echo '\n```\n' >> $DAILY                                         
                                                                 
echo '\n<div style="page-break-before:always;"></div>' >> $DAILY 
echo "## Todo\n" >> $DAILY                                       
cat ~/vimwiki/todo.wiki |grep "\[ \]" >> $DAILY                 

pandoc -f markdown -i $DAILY -o /tmp/Daily.epub --toc --metadata title="Daily PDA" --metadata author="$DATE"                      
ebook-convert /tmp/Daily.epub $KINDLE/Daily.mobi

sync
sudo eject $DEVICE

Experiment 3: Cyberdeck and/or Permacomputer

While my immediate need for distraction-free and offline consumption is fulfilled, I'm still thinking deeply about distraction-free computing (not just consuming). I don't write often enough to need a device for typing, but I do think about how I could operate offline, for example if I am travelling. It would be great if I could write some code or answer some emails in an offline way, and sync perhaps once a day. If I accept the limitation of not running a modern web browser (or Electron apps), what could I get away with?

As a starting point, I looked into Kiwix. With Kiwix, I can download all of Wikipedia and have it offline and searchable (and it's only 87Gb for English Wikipedia). Even better, I can download all of StackOverflow! Also Arch wiki, and MDN! Now I know what to queue up for nightly downloads for the next few months. These could all fit onto several USB sticks, or an external hard drive. I'm envisioning how cool it will be when I look up bird species on trips, while completely offline...

Coming back to the no-web-browser thing, could I maybe use alternative frontends for when I am online? I found for example that you can use `socli`, a StackOverflow CLI tool, to search StackOverflow in a terminal. There are CLI frontends for YouTube, even F1TV (called `f1viewer`)! The big advantage here apart from not needing a web browser, is that the video is played in an optimized player like VLC. There's a great list here, although many of them are not CLI tools:

alternative-front-ends

This makes me think that it might be possible to make a portable device with built-in keyboard, that powers up fairly quickly, runs for a day or more on battery power, and is mostly running CLI tools and playing media in mpv/VLC. This wouldn't replace my main desktop, but this could be the distraction-free computing device to replace a smartphone for me. It might even be a permacomputer, or as Ploum called it, a FutureComputer. Perhaps it could even be as cool as this:

(YouTube) Hacking Dystopia with a Pi 400 Cyberdeck

But now I've looped around to being online, which means I need to design yet another device specifically for online media, but distraction-free ofcourse...

__

Home

Email me