Is it possible to do all of my tasks from the linux tty? Just how much of my workflow could be transplanted to a text-only interface? I decided to use this pandemic-vacation to find out. This is a post about how many surprisies the Linux command line has in it's sleeves.

Xorg, you shall not pass!

Now that we have a black background with a blinking cursor, what do we do?

$ vim Xworkflow.txt

As a biology student those are the thinks I have to do on a daily basis:

Check the university web-portal for assignments and download the pdfs

a lot of web browsing for research and stuff. Also youtube, reddit, twitter, etc

I bought a 2 in 1 Laptop for the explicit purpose of annotating the pdfs the professors send us, as well as making drawings and schemes of plants, bacteria and stuff. So using the touchscreen is important to me.

Spotify

Im not a professional Developer but I do some stuff with javascript. Also as a Linux user I spend a lot of time opening up config files.

open a lot of pdfs and ebooks for studying, often I need to have several pdfs open at the same time.

Netflix/amazon prime

$ vim ttyWorflow.txt

Lets begin with the easy stuff: Goodbye touchscreen. Touch events are handled directly by Wayland or X11, so no.

Next the things I knew would work very well: there are a lot of cli programs for linux and discovering them is a joy, `ncspot`for instance is an amazing spotify client. Text editing is a nobrainer for the tty, and learning the vim workflow is a must-have if you are thinking on living the Terminal life. But not everything is made of hjkl, wordgrinder is a word processor that does the job and gets out of your way. It has a menu system and can read odt files (some professors think it's okay to upload the class notes in Word format). I wrote this simple web page in vim, but had to use a normal web browser to see the css.

Some window management is needed for all this programs, and tmux it was, easy to use and very customizable it was a central pillar of my setup. Other than tweaking some keybidings the only customization I did was installing a pluggin to show the battery percentage and one for showing a Nerwork managaer window.

For email I used neomutt, it does what it is supposed to and is very confugurable, as cli programs should be.

now the part that doesn't work as well: web browsing. Luke Smith was very right when he said "the web nowadays is so bloated you need a bloated browser", we of course have text based alternatives like elinks and w3m (poor things, they don't stand a chance agaist the modern web) and I was able to do way more with them than I expected, but at the end of the day some websites are unusable without css and javascript (my university portal for example). Seeing a text only web is a nice experience though, the sites that did work were very enjoyable to read in the tty (try reading this blog post), and I even managed to display images on full resolution! Yes, on the tty.

Media:

So it is possible to display iamges and video on the tty, eliks can open links using external programs, if you configure it to open jpgs and pngs with fim

set mime.handler.image_viewer.unix-xwin.program = "fim %"

set mime.handler.image_viewer.unix.program = "fim %"

it will magicaly open the file fullscreen using the linux framebuffer*. fim can open pdfs** as well. The downside is it opens everything fullscreen and you can't really multitask while using it, so no multiple pdfs at once for me.

Browsing websites on the tty sucks, but in some cases you don't have to: tuir is a cli reddit client that works very well. You can use fim to display images and mpv to display video. Fullscreen full resolution video from reddit in the tty, isn't it amazing?

image/*; curl -s '%s' | convert - jpg:/tmp/rtv.jpg && fim /tmp/rtv.jpg; needsterminal; copiousoutput

video/*; mpv --vo=drm -quiet '%s'; needsterminal

I couldn't find a workinkg youtube client for the terminal, the closest I got was using newsboat to subscribe to a chennel's rss, which works fine.

Netflix and Amazon Prime might work as well, I tried get mpv to read the netflix urls but it only fetches the trailer. I suppose it is an authentication issue, passing the right parameters to youtube-dl might work.

Conclusion

I did't expect to be able to move my entire workflow to the tty, I was, however, very impressed with just how much of it worked out. Browsing reddit and multitasking with tmux while listening to music in the background made me fell like I was in a desktop environment like any other.

This experiment made me learn a lot about the shell we all live in and how things interact with one another in Linux. This modularity is what makes cli programs so great: you are free to make them work together to do new things or adapt them to function on a new context.

* you need to add yourself to the video group for that to work

** for pdfs you need to use the fimgs wrapper that is included in the fim package