💾 Archived View for gemini.cyberbot.space › gemlog › 2022-02-08-pineda.gmi captured on 2024-03-21 at 15:13:59. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

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

PineDA (Pinephone Palmtop PDA)

2022-02-08

I have had the keyboard accessory for my Pinephone for a bit now and I have been working on customizing my computing environment. What I'm doing here is a continuation of and building upon what I started doing years ago with the PocketCHIP. The gist is that, out of necessity in the PocketCHIP's case, through a terminal with carefully selected applications an extremely lightweight and still very fun and useful computing environment can be had. With the Pinephone's increased specs (compared to the PocketCHIP :-P) this can be even more functional. The CPU and RAM are significant increases but the more impactful part is the larger and higher res display, the much better keyboard and the more pocket friendly form factor.

My inspiration for doing this comes from my love for PDAs which is what I'm attmempting to approximate with the simple terminal interface. In some ways it feels similar to me while also being super flexible because it is still a flippin whole linux computer. Pretty dang neat IMO!

I'm terrible at documenting my steps for things and writing them up so I'm going to do an overview of the various components of how I set my PineDA up which should give any interested parties enough to go on. If there is anything you want to know about any of this feel free to reach out to me through email.

Short demo video

Base OS

The OS I am using is PostmarketOS Edge with the SXMO UI. This is a really nice, stable and lightweight system and SXMO is by far the best performing UI on the Pinephone. SXMO is now based on wayland, sway wm and various lightweight tools and scripts to taylor to the specific features of the Pinephone hardware. There are gestures for various commonly needed things and very slim and flexible scripts for dealing with the phone functions. It makes for a unique and well performing system that feels a lot more like using a tiny computer than a smartphone but still exposes the phone functionality.

PineDA Interface

The "PineDA Interface" that I've cobbled together is really just a mish mash of configs, terminal programs and simple scripts. Not being a programmer this is about as complex as I get but I'm having fun playing with digital legos to put this together.

Main components of the interface:

Sakura

The reason for choosing sakura is simple, it supports mouse interaction. This is key to this setup because tmux, tui_launcher and some of the terminal apps support mouse and because the touch panel is interpreted as a mouse pointer that means you can interact with the terminal using the touchscreen!

Tmux and Scripts

This tmux config started on my PocketCHIP. The goal was to be as minimal as possible to leave as much screen as possible for the currently running program and window tabs while still showing info I want to know. Very important on the PocketCHIP's 4.3" low res display. The Pinephone has a larger screen and higher res which helps a lot but the same concept is still beneficial.

Instead of using any of the readily available tmux status system info scripts or plugins I opted to do my own thing. That allowed me to save space and pick precisely the info I wanted and nothing else. One neat trick I figured out is using sparklines to make those cool looking and extremely space efficient(1 single caracter!) bar graphs for CPU, RAM and battery. The sparklines program is just a bash script and you can find the command for downloading it and putting it into your $PATH on the github page.

https://github.com/holman/spark

Note: Some of my status scripts do not work with the busybox versions of the utilities that are the default in PostmarketOS. This is easy to fix by installing the full versions which are available in the repos. The sysstat package is the main one needed.

tmux config

tmux status scripts

Tmux also supports mouse interaction as I mentioned before. This makes it possible, and even more convenient IMO, to do things like switch windows and resize panes. Just tap the window title at the bottom to switch windows or drag the divider line between panes with your finger to resize.

The final piece is the line at the end of the sway config that runs my script for launching the sakura/tmux interface. I have also added an entry to the SXMO scripts menu that runs the same script in case I close out of sakura/tmux.

Run the script at boot.

exec sakura -e ~/pda.sh

Contents of the script.

#!/bin/sh
tmux new-session -A -c ~/builds/tui_launcher/ -s PDA -n Home ./launcher.py --term-width="$(tput cols)" --config-file ./configs/pdalaunch.py

tui_launcher

This awesome little program (thanks to FiXato) serves as the home screen and touch friendly application launcher. Create buttons that run whatever command you want. I use this in a couple other places to control my home music system, sending commands to switch playlists, adjust volume, play/pause, skip etc. Here I am attaching commands to the buttons to launch a program in a new tmux window. Since there are only so many buttons that will fit I am choosing my most used applications for the buttons and have a button for "Terminal" that just opens a window to a command prompt when I want to do anything else. You can read a little more about my use of tui_launcher on my Terminal Dashboard page.

Terminal Dashboard

tui_launcher

Terminal Applications

You can see some of my most used apps in the video at the top. Rather than list everything here I am just going to point you to my terminal apps page. Some of my general app choices differ slightly on the Pinephone because some just aren't as well suited to the Pinephone's screen size. For example on a larger display I kind of prefer the calcurse interface but the simpler and more compact khal interface just works better on a smaller display.

Terminal Programs I Like

Final Words

This is a still evolving setup that is not and may not ever be "finished" but it is in a pretty usable state now. This is not a step by step guide. If you are trying to replicate some part of this it will likely take some reading or examining of my config/scripts to see what they are doing if you run into any snags. Luckily none of it is complicated and you can email me if you can't get something working. I'll do my best to help. On another note, if you see any ways of improving anything in my setup please also email me and let me know!