Appendix · reference

Mobile software

What runs on top of the kernel: sxmo-style userland, telephony scripts, and per-category app picks for an X11 phone.

This entry summarizes MOBILE_SOFTWARE.md in the repo root — a userland inventory for the FreeBSD-on-PinePhone-Pro setup. Where the rest of this site is about the kernel, drivers, and firmware, this is about everything above init: window manager, on-screen keyboard, gesture daemon, telephony scripts, and per-category recommendations for browser, email, music, calendar, etc.

The full document includes detailed comparison tables for every category and a phased install plan. The summary below picks the load-bearing decisions; consult the source doc for the long tables.

Our setup baseline

The critical environment variable

GTK4 apps must be launched with:

export GSK_RENDERER=cairo

Without it GTK4 fails or renders garbage on scfb. GTK3 apps already default to Cairo on X11 and don’t need it.

Sxmo as the reference

Sxmo is the canonical X11 mobile environment for the PinePhone family. We borrow heavily from its architecture: dmenu/rofi for menus, dunst for notifications, slock for screen lock, shell scripts for everything else. The sxmo gesture map (lisgd) is the direct model for our gesture bindings — edge swipes for back/forward, swipe-up-from-bottom for app menu, swipe-down-from-top for the on-screen keyboard.

What we can’t steal from sxmo: the dwm patches (we use i3), callaudiod (Linux-only audio daemon — we’ll use sndio/OSS), ModemManager/mmcli (replaced with direct AT commands), pipewire (Linux-only).

Telephony stack: AT commands, not ModemManager

FreeBSD has no ModemManager, so we talk directly to the EG25-G over USB serial. The modem exposes four ports:

DevicePurpose
/dev/cuaU0DM (diagnostic)
/dev/cuaU1GPS NMEA
/dev/cuaU2AT command port (primary interface)
/dev/cuaU3PPP data

The plan is a small set of shell scripts modeled on sxmo:

Reference repos: fuzzybritches0/pinephone (bash AT scripts), milky-sway/pinephone-scripts, and the gold-standard sxmo-utils.

Audio routing for calls is still blocked on the RT5640 driver — without working playback/capture, even a perfect dialer can’t carry voice.

Per-category app picks (one-line summary)

The full document compares 5–8 options per category in a table; the short version of the picks is:

CategoryPick (FreeBSD pkg)Notes
BrowsernetsurfLightweight; falls back to surf for sites needing better rendering, w3m in terminal
File managernnn (terminal) / pcmanfm (GTK2)Both touch-usable
Musiccmus (TUI) / mpv (CLI)Daemon setup: musicpd + ncmpcpp
EmailaercModern terminal client, works with svkbd
CalendarcalcurseTerminal, lightweight, touch-usable
Notesplain text + vi/nanoSxmo approach
CalculatorgalculatorGTK2, big touch targets, no GPU
MapsfoxtrotgpsOSM tiles, offline cache, GPS support
RSSsfeed (sxmo style) or newsboat
Podcastsnewsboat + podboat + mpvAll in pkg
PDFmupdf (touch pinch-zoom) / zathura (keyboard)
Image viewernsxivThumbnail mode works on small screens
CameraBlocked: no V4L2/media-request on FreeBSD
Clock/alarmshell + at/cron + dunst
Weathercurl wttr.inZero deps
Password managerpass + rofi-pass
Night lightredshiftX11 native
Messagingweechat (IRC + Matrix) / profanity (XMPP)

What not to bother with

Phased install plan (verbatim from the doc)

Phase 1 — Core mobile UX (now)

ssh honor "pkg install -y dmenu rofi dunst slock xautolock xdotool \
  xclip xrandr redshift conky htop picocom"

Then configure: lisgd gestures, dmenu/rofi launcher, dunst notifications, slock on power button, xrandr rotation, brightness script, redshift auto night mode.

Phase 2 — Communication (after modem + SIM working)

Install minicom and picocom; build the AT shell scripts above.

Phase 3 — Daily apps

ssh honor "pkg install -y netsurf pcmanfm nnn galculator calcurse \
  newsboat sfeed feh nsxiv mupdf zathura zathura-pdf-mupdf mpv cmus \
  password-store"

Phase 4 — Rich apps (after audio works)

ssh honor "pkg install -y musicpd ncmpcpp aerc foxtrotgps gpodder"

Phase 5 — Optional enhancements

ssh honor "pkg install -y gnome-calculator gnome-clocks gnome-weather \
  geary keepassxc pidgin weechat profanity"

Remember GSK_RENDERER=cairo for everything GTK4/GNOME.

i3 keybindings for mobile use

Suggested additions to ~/.config/i3/config:

bindsym $mod+d exec rofi -show drun -theme mobile
bindsym $mod+p exec rofi-power-menu
bindsym $mod+k exec pkill svkbd || svkbd-mobile-intl -d
bindsym $mod+l exec slock
bindsym XF86MonBrightnessUp exec brightness-up.sh
bindsym XF86MonBrightnessDown exec brightness-down.sh
bindsym XF86AudioRaiseVolume exec pamixer -i 5
bindsym XF86AudioLowerVolume exec pamixer -d 5
bindsym XF86AudioMute exec pamixer -t
bindsym Print exec scrot ~/screenshots/%Y-%m-%d-%H%M%S.png
bindsym $mod+r exec rotate-screen.sh

Brightness without xbacklight

scfb doesn’t support xbacklight/RandR backlight. The PWM backlight is reachable through pwm_backlight (sysctl) or — last-resort — a direct register poke. Wrap whichever method works in brightness.sh and bind it to gestures or volume buttons.

Battery monitoring

The RK818 PMIC has an on-chip fuel gauge; the driver loads but doesn’t yet expose to userspace. Until it does, polling I²C registers directly is the workaround:

# RK818 on i2c0 addr 0x1c
# 0x21 = BAT_VOL_REGL, 0x22 = BAT_VOL_REGH
i2c -a 0x1c -d r -c 1 -o 0x21 ...

Convert voltage to percentage in your status-bar script.

Cross-references