User:Knuxfanwin8/Dogfooding: Smart information display

From postmarketOS
🚧 This page is a work-in-progress. Some information contained within may be inaccurate or incomplete.

Back in early 2022 (back when the pandemic was still ongoing, and I had much more time on my hands) I began work on a UI called Aspinwall. I had the idea of making a Google Nest Hub-like UI that could be run on any device, complete with voice support, that could also be used as a standard tablet.

I worked on the project for the YH4F (Youth Hacking 4 Freedom) competition, and it even got third place!... but unfortunately, the deadline made me crunch more than I ideally would've, and I ended up losing interest in the project. Other than burnout, I felt like the performance was worse than I had initially planned - but that shouldn't be too surprising, given that I chose Python as my programming language. I never ended up finishing the project entirely; all I had was the 99% complete launcher, a somewhat-working Mycroft GTK+Adwaita client and a proof-of-concept shell.

Recently, I decided to take another look at it, and found that it wasn't nearly as bad as I remembered - actually, after some additional tweaks, I ended up getting the launcher into a reasonably usable state.

With that said - since I've got other projects to work on, I am not planning to continue working on Aspinwall, but perhaps someone else will see this and get inspired... or maybe I'll get inspired along the way ;)

Choosing the UI

My initial idea encompassed a full shell - from the WM, to the general UI shell, and finally, the launcher. Out of all of these parts, only the last one was ever completed, so we need an UI to power the entire project.

I've always planned to use the UI on my old tablet, the Samsung Galaxy Tab 3 8.0 (samsung-lt01wifi). The primary blocker at the time was that on the downstream kernel, I couldn't rotate the screen, meaning that it was always stuck in portrait - not ideal for an information display. However, since I've managed to mainline the device since, I figured I'd give it another shot.

Unfortunately, that device is rather old - the dual-core Exynos 4212 chipset, 1 usable GB of RAM and rather old Mali 400 GPU (which only supports GL 2.1 and GLES 2.0 - too low to get any kind of meaningful hardware acceleration in modern software...) make pretty much anything run at slow speeds. That's alright - for a display that sits on my desk and looks pretty, we don't need great performance.

Nonetheless, I initially experimented with Phosh, and while it worked fine, if I wanted to get any real use out of this tablet (outside of running Aspinwall on it), I needed a lighter UI. So, I ended up going with XFCE4.

XFCE4, being Xorg-based, requires an xf86-video- package to enable hardware acceleration for X windows. Unfortunately, there is no such package for the Mali GPU - so I'm stuck with software acceleration. Oh well.

There was another small issue with XFCE that I encountered - when I rotated the screen, the touchscreen wouldn't rotate with it. I solved this by creating two shell scripts that I placed on the desktop, and added the landscape script to autostart (otherwise XFCE would remember the last screen rotation, but not the touchscreen rotation, rendering the device useless on reboot).

landscape.sh:

#!/bin/sh
DISPLAY=:0 xrandr -o right
DISPLAY=:0 xinput set-prop "pointer:MELFAS MMS114 Touchscreen" --type=float "Coordinate Transform Matrix" 0 1 0 -1 0 1 0 0 1

portrait.sh:

#!/bin/sh
DISPLAY=:0 xrandr -o normal
DISPLAY=:0 xinput set-prop "pointer:MELFAS MMS114 Touchscreen" --type=float "Coordinate Transform Matrix" 0 0 0 0 0 0 0 0 0

With that, I was able to switch between the two screen orientations using a quick desktop shortcut.

Running the launcher

Since I never fully finished the project, I never packaged it in Alpine. However, it's still possible to run it from source.

Get the prerequisites:

$ sudo apk add git meson gtk4 libadwaita glib-dev desktop-file-utils

Clone the repo:

git clone https://github.com/aspinwall-ui/aspinwall-launcher
cd aspinwall-launcher

Modify the run script to remove the GTK_DEBUG=interactive part of the run command, then run the ./run script.

If all goes well - you should have a working launcher! Congrats!