Trapu PhonesInstall
Guide for agents, and the people who run them

Build Trapu with your agent

Every Trapu app is a small C program on GTK 4 and one shared library, with written conventions and tools that check a layout at any screen size. That makes it work an AI coding agent does well, if it knows the rules. This page is those rules, with a brief you can hand your agent as it is. The second half is the whole ROM: how an installer image is put together, and how to make one for a phone that Nura (postmarketOS) supports, whether it runs Phosh or anything else today.

Trapu was called VibeOS until now. The files, the packages and what the device shows (the installer, the boot menu, the login screen) still say VibeOS or vibeos.

The idea

On Android or iOS an app you write for yourself goes through an SDK, a signing key and often a store. On Trapu it is a program on your own Linux phone: build it, install it, and it is on the home screen the same minute. Improve the Calendar you use every day, or write the app nobody else will make for you.

What keeps it good is the base it stands on:

Set up

You need Debian unstable or Mobian (arm64 for the phone; any architecture to build and run the libraries' tests) and the source:

git clone https://github.com/pulpoff/vibeos
cd vibeos
sudo apt build-dep .

The quick loop: one app against the installed libraries

Install the runtime and development packages from the Trapu apt repository (set up as on the front page). apt keeps them all at the same version, which matters: an app depends on the exact libvibeos version it was built with.

sudo apt install libvibeos-dev libspongy-dev libtonal-dev gir1.2-spongy-1 fonts-vibeos-roboto

Each app is a meson project of its own, so it builds from its directory alone:

meson setup build apps/dictate
ninja -C build
meson test -C build

Checked on 2026-11-17: Dictate's directory, copied out of the tree, builds against the 0.1.1 packages on arm64 with no warnings and passes its test.

To try it on the phone, sudo ninja -C build install puts it under /usr/local, where the launcher finds its desktop file as long as /usr/local/share is in $XDG_DATA_DIRS (it is in a stock GNOME session). For anything you will keep, build a package (below).

The whole tree

dpkg-buildpackage -b -uc -us                         # everything, with every test
DEB_BUILD_OPTIONS=nocheck dpkg-buildpackage -b -uc -us   # without the tests

debian/rules builds the meson projects in order: the top level (libspongy, libtonal, the launcher and the daemons), then libvibeos, extension, session and the apps. Later projects find the earlier ones uninstalled, through PKG_CONFIG_PATH. Change libvibeos and an app together this way.

Anatomy of an app

There is no generator. Start from apps/dictate: it is the smallest complete app on libvibeos, with a settings schema, D-Bus activation and tests. Copy it, rename every dictate/Dictate, and empty what you don't need. apps/contacts is the reference for the newer layout widgets (top bar, card lists, list and detail, navigation rail).

One id everywhere

For an app called Notes: the GApplication id, the desktop file's name, the D-Bus name, the icon name and the settings schema id are all vibeos.Notes. The schema path and the resource prefix are /vibeos/Notes/. The binary, the package and the gettext domain are vibeos-notes. The shell matches windows to apps by the desktop id, so they must agree.

FileWhat it holds
meson.buildIts own project() with warning_level=2, c_std=gnu11, buildtype=release; dependency('vibeos-1') and dependency('spongy-gtk-1'); the gresource, the executable, the D-Bus service file, the desktop file, icon and schema, gnome.post_install(), and test()s.
src/notes-main.cA GtkApplication with APP_ID "vibeos.Notes". In startup: vibeos_init (), then the app's own CSS at GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1. In activate: present the one window.
src/notes.gresource.xmlPrefix /vibeos/Notes: the CSS, and the app's symbolic icons under icons/scalable/actions/, where GtkApplication looks for them.
src/notes.cssThe app's styles, in colour roles (@vibeos_primary…), never colour values.
data/vibeos.Notes.desktopExec=vibeos-notes, Icon=vibeos.Notes, DBusActivatable=true, X-Purism-FormFactor=Workstation;Mobile;, Categories, Keywords.
data/vibeos.Notes.service.inThe D-Bus service: Exec=@bindir@/vibeos-notes --gapplication-service.
data/vibeos.Notes.gschema.xml<schema id="vibeos.Notes" path="/vibeos/Notes/">.
data/vibeos.Notes.svgThe app icon (hicolor, scalable).
tests/test-*.cTests of the app's logic. The pattern: put the non-GTK code in a static_library that the app and the tests both link.

Apps that work while closed

Clock, Phone, Messages and Calendar ring, receive and remind with their window closed. Each has a second, small binary run as a systemd user service that is also D-Bus activatable (Type=dbus, PartOf=graphical-session.target, Restart=on-failure), and the window talks to it. Copy apps/clock's vibeos-clock-alarms for the shape. To wake the phone from suspend at a time, call the system service vibeos.Wakeup's Set (s name, x time, a{sv} options); it stores nothing, so set it again when its bus name reappears.

Desktop-file keys the shell reads

libvibeos

#include <vibeos.h> brings in all twenty headers. Call vibeos_init () in GApplication::startup, before the first window, and make windows with vibeos_window_new (app): it carries the vibeos style class and an overlay for dialogs and snackbars.

Widgets

HeaderGives you
vibeos-pressable.hAnything tappable, with the ripple; text buttons, 48 dp icon buttons, FABs; long press after 400 ms
vibeos-top-bar.hSmall, large (collapsing) and contextual (selection) top app bars, with a Back the shell finds
vibeos-list-row.h, vibeos-card-list.hSettings-style rows (icon, avatar, switch, chevron, value) on segmented cards in groups
vibeos-nav-bar.h, vibeos-nav-rail.hThe bottom navigation bar; the navigation rail of a tablet
vibeos-layout.hPhone or tablet, compact / medium / expanded, landscape, and a changed signal
vibeos-list-detail.h, vibeos-page-stack.hList and detail in two panes on a tablet and one on a phone; pages pushed and popped with Material's transitions
vibeos-fab-column.hA FAB with two small buttons, as a row or a column by shape
vibeos-search.hThe search pill and the full search view
vibeos-dialog.h, vibeos-snackbar.hIn-window alert dialogs (scrim, Escape and Back give Cancel); snackbars
vibeos-switch.h, vibeos-time-picker.hThe Material 3 switch; the clock-face time picker
vibeos-anim.h, vibeos-ripple.hOne value animated on the frame clock along Material's curves; the ripple for widgets you draw yourself
vibeos-style.h, vibeos-text.hColours, theme, scale; text sizes, Font size and Bold text

Scrolling is libspongy's SpongyScrollView: touch drag, fling and Android's stretch at the ends, in place of a GtkScrolledWindow. Colours come from libtonal, a C port of Google's Material Color Utilities; apps never call it directly.

Colours

Write colour roles, never values: @vibeos_primary, @vibeos_on_surface, @vibeos_surface_container… in CSS, vibeos_color (VIBEOS_COLOR_PRIMARY) in C. The roles are the Material 3 scheme of the user's seed colour or wallpaper, light or dark, and they change while the app runs: read them at draw time, and re-read anything you cached in VibeosTheme::changed.

Sizes and type

What the shell expects

Back

Trapu has no back button: the edge swipe looks at the app through accessibility (AT-SPI) when the finger lands. What it does, in order:

  1. a visible, sensitive button with the accessible name "Back" in the top 40 px of the window: Back clicks it;
  2. an open dialog or file chooser: Back sends Escape;
  3. otherwise Back leaves the app for the home screen.

So label every back arrow (VibeosTopBar does it for you; by hand, gtk_accessible_update_property (w, GTK_ACCESSIBLE_PROPERTY_LABEL, _("Back"), -1)), keep it in the top band, and close dialogs on Escape. A page with no visible arrow can carry an invisible "Back" (see apps/calendar/src/event-editor.c).

Keyboard, rotation, notifications

Stock services only

Calls and SMS through ModemManager, contacts and calendars through evolution-data-server, the camera through libcamera, location through GeoClue, sensors through iio-sensor-proxy, networks through NetworkManager, haptics through feedbackd. Never check which phone it is: Trapu's rule is that every app runs on any Mobian device.

Push notifications

Coming in the next release. The push server is live. The phone's push service and the libvibeos API below are being built now. The API is fixed, so you can write against it today, and the server side of your app works already.

A Trapu app never keeps its own connection to its server open and never polls. Trapu uses UnifiedPush, the open standard for this. One push service on the phone keeps a single connection to the push server for all apps, and starts your app over D-Bus when a message for it arrives. Your server sends standard Web Push, so a server that already sends Web Push to browsers needs no new code. The message is encrypted for your app on the phone: the push server never sees what is in it.

  1. Your app registers on every start. It gets an endpoint URL and its keys, and sends all three to your server.
  2. Your server POSTs an encrypted message to that endpoint: Web Push, encrypted with RFC 8291 (aes128gcm) and signed with VAPID (RFC 8292), as for a browser.
  3. The phone collects it, starts your app if it is not running, and libvibeos decrypts the message and hands it to you. You show a notification or update your data, and return.

In the app

#include <vibeos.h>

static void
on_endpoint (VibeosUnifiedPush *push, const char *endpoint,
             const char *p256dh, const char *auth, gpointer app)
{
  /* send all three to your server, every time this fires */
}

static void
on_message (VibeosUnifiedPush *push, GBytes *message, gpointer app)
{
  /* already decrypted: parse it, show a GNotification, update your data */
}

static void
startup (GApplication *app)
{
  VibeosUnifiedPush *push = vibeos_unified_push_new (app, NULL);  /* keep it for the app's lifetime */

  g_signal_connect (push, "new-endpoint", G_CALLBACK (on_endpoint), app);
  g_signal_connect (push, "message", G_CALLBACK (on_message), app);
  vibeos_unified_push_register (push, NULL, YOUR_VAPID_PUBLIC_KEY);
}
Call or signalWhat it does
vibeos_unified_push_new (app, instance)One object per registration. Most apps pass NULL; a messenger with several accounts makes one per account ("account-2"…).
vibeos_unified_push_register (push, description, vapid)Call it on every start. description is what Settings shows (NULL: the app's name); vapid is your server's VAPID public key, base64url (87 characters), or NULL.
vibeos_unified_push_unregister (push), vibeos_unified_push_get_endpoint (push) Stop receiving; the current endpoint (NULL until registered).
new-endpoint (endpoint, p256dh, auth)The endpoint or the keys are new or changed: send all three to your server. p256dh and auth are base64url, the same fields as a browser's PushSubscription.
message (GBytes)A message, already decrypted.
unregisteredPush for this app was removed (in Settings, say): tell your server to stop sending.
registration-failed (reason)The UnifiedPush reason: NETWORK (try again later), VAPID_REQUIRED, ACTION_REQUIRED, UNAUTHORIZED, INTERNAL_ERROR.

For the phone to start your app when a message comes, install a D-Bus service file under the app's id:

# /usr/share/dbus-1/services/vibeos.Notes.service
[D-BUS Service]
Name=vibeos.Notes
Exec=/usr/bin/vibeos-notes --gapplication-service

Started that way, the app opens no window: windows belong in activate, which a service start skips. libvibeos holds the application while your message handler runs, and lets it exit after.

On your server

You can test your server without a phone. Pick a topic of your own (up and 12 characters), watch it the way the phone's push service does, and point your server at its endpoint:

T=up$(head -c 9 /dev/urandom | base64 | tr '+/' '-_')
echo "endpoint: https://push.vibeos.top/$T?up=1"
curl -sN "https://push.vibeos.top/$T/json?up=1"   # each message arrives here, base64-encoded (still encrypted)

While the phone sleeps

Any Linux app that speaks the UnifiedPush D-Bus specification (version 0.3) works with Trapu's push service, whatever library it uses.

Test at every size and setting

Settings any libvibeos app reads from its environment

VariableEffect
VIBEOS_LAYOUT=phone, tablet, tablet,expanded…Forces the layout classes
VIBEOS_COLOR_SCHEME=light / darkLight or dark
VIBEOS_SEED=#RRGGBB, VIBEOS_CONTRAST=-1..1Another colour scheme
VIBEOS_FONT_SCALE=0.5..3, VIBEOS_BOLD_TEXT=1Font size and Bold text, in apps that follow them
VIBEOS_SHOT=/path.pngThe window renders itself to a PNG a second after it shows, and again on every SIGUSR1
VIBEOS_DUMP=/path.xmlThe widget tree, uiautomator's format, with bounds in dp
GSK_RENDERER=cairoCompare with the software renderer

A phone or tablet display of its own: tools/vibeos-headless

A headless mutter on a private bus, sized like a real screen, so an app can be shown, tapped, photographed and dumped while the phone itself stays locked or in use. It runs as root on the phone, from the source tree, and starts the apps as the session user (VIBEOS_USER, default user).

VIBEOS_HEADLESS_SIZESize (dp)ScaleStands for
phone360 × 7213×Galaxy S10e upright, under its status bar
phone-land760 × 3323×the same on its side
tablet1280 × 7402×Galaxy Tab S5e on its side
tablet-port800 × 12202×the same upright
WxHany3×, or VIBEOS_HEADLESS_SCALEwhatever you need
# on the phone, as root (sudo -i), in the source tree
export VIBEOS_HEADLESS_SIZE=tablet
tools/vibeos-headless start
tools/vibeos-headless run env VIBEOS_COLOR_SCHEME=light VIBEOS_FONT_SCALE=1.3 vibeos-notes
tools/vibeos-headless shot /tmp/notes-tablet-light.png
tools/vibeos-headless dump /tmp/notes-tablet-light.xml
tools/vibeos-headless tap 640 300          # dp
tools/vibeos-headless swipe 640 600 640 200
tools/vibeos-headless stop

A copy of the app already open on the phone's own screen keeps its window there; close it first. A second display beside the first takes VIBEOS_HEADLESS=another-name on every command.

The matrix to go through

Look at every screenshot: clipped text, overlaps, a colour that doesn't follow the theme, a touch target smaller than 48 dp. The dump gives the bounds in dp, so an agent can check them as numbers.

Against a reference: tools/vibeos-specdiff

When the app has a counterpart on Android, compare layouts by the numbers:

tools/vibeos-specdiff RULES.specdiff OURS.xml REF.xml   # REF.xml: uiautomator dump from Android

A rule is one line, name | our expression | reference expression [| spec value], over x0 y0 x1 y1 w h cx cy of a selector such as "id=title" or "text~=Contacts". It passes within 1 dp. The rule files in apps/contacts/tests/specdiff/ are the examples. The exit code is 0 for a pass, 1 for a measurement out of tolerance, 2 for a broken rule.

Automatic tests

Package it

For an app that ships with Trapu, beyond its own directory:

  1. debian/rules: add it to APPS.
  2. debian/control: a stanza like vibeos-dictate's, and the app in the vibeos metapackage's Recommends.
  3. debian/vibeos-notes.install: every installed path, the user unit too if it has one.
  4. A man page: debian/vibeos-notes.manpages → debian/man/vibeos-notes.1.
  5. debian/copyright: your own icon needs a stanza of its own, because the existing apps/*/data/*.svg one says Apache-2.0 from AOSP.
  6. The VibeOS icon pack: a line in ICONS (glyph, background, glyph colour) and the desktop id in MAP in tools/iconpack-vibeos/make-vibeos-pack.py, then regenerate. Likewise the gnome-free pack.
  7. Optionally a cell on the home screen in vibeos-launcher/data/layout.json; otherwise the app goes to the first free cell.
  8. The README's app table, with docs/icons/notes.png and a screenshot in docs/screenshots/.

An app you keep for yourself needs none of this: its own debian/ directory, or ninja install, is enough.

Quality checklist

The brief for your agent

Save this as AGENTS.md (or CLAUDE.md) in your checkout, or paste it at the start of a session:

# Building VibeOS apps

VibeOS is a touch-first GNOME system on mainline Linux phones (Debian/Mobian, arm64). Apps are C (gnu11) on GTK 4
and libvibeos (Material 3 widgets, colours, type, motion), with libspongy for scrolling. Guide: https://vibeos.top/agents

## Start
- Copy apps/dictate for a new app; apps/contacts shows the layout widgets (top bar, card list, list-detail, nav rail).
- One id: vibeos.X is the GApplication id, desktop file, D-Bus name, icon and schema id; /vibeos/X/ the schema path and
  resource prefix; vibeos-x the binary and package.
- Build one app: meson setup build apps/x && ninja -C build && meson test -C build
  (needs libvibeos-dev, libspongy-dev and libtonal-dev of one version). Whole tree: dpkg-buildpackage -b -uc -us.

## Rules
- startup: vibeos_init_full (VIBEOS_INIT_SCALED_TEXT), then the app CSS with
  vibeos_css_load_resource ("/vibeos/X/x.css", GTK_STYLE_PROVIDER_PRIORITY_APPLICATION + 1).
- Windows from vibeos_window_new (); widgets from libvibeos; scrolling with SpongyScrollView.
- Colours are roles only (@vibeos_primary, vibeos_color ()); re-read cached ones on VibeosTheme::changed.
- Text in sp, sizes in dp; touch targets >= 48dp; Material 3 type classes (.vibeos-title-large ...).
- Back: label every back control "Back" (accessible name), keep it in the window's top 40 px, close dialogs on Escape.
- Phone and tablet both: use VibeosLayout / VibeosListDetail; a tablet keeps its layout upright too.
- Stock services only (ModemManager, EDS, libcamera, GeoClue, iio-sensor-proxy, NetworkManager, feedbackd);
  never check which device it is.
- Work with the app closed = a systemd user service that is D-Bus activatable (see apps/clock, vibeos-clock-alarms).
- Messages from your server: VibeosUnifiedPush (libvibeos, Web Push on the server), never a socket of your own or
  polling; the app is D-Bus activatable with --gapplication-service. https://vibeos.top/agents#push
- Strings in _(); every file opens with a comment on what it is; comments say what the code does and why.
- Never place real calls or SMS, never touch the user's real contacts or calendars: use the mocks and seeds in tests/.

## Check
- meson test; no compiler warnings.
- As root on the phone: tools/vibeos-headless with VIBEOS_HEADLESS_SIZE=phone, phone-land, tablet, tablet-port;
  run the app with env VIBEOS_COLOR_SCHEME=light|dark VIBEOS_FONT_SCALE=1.3; take shot and dump; look at every
  screenshot and check bounds in the dump.
- Against an Android reference: tools/vibeos-specdiff RULES OURS.xml REF.xml (within 1 dp).

A whole ROM image

Apps are half of it. The other half is the image a phone installs: Debian with Trapu on it, plus the phone's own kernel and firmware. The tools that made the images on Releases are in the repository under image/, with a README for each part, and an agent can drive them like the app tools.

An installation is two zips that LineageOS's recovery installs one after the other, in one session:

So a new phone needs only its device zip, and for a phone Nura already supports, a converter makes it. The installers never write efs, modem, persist or any partition they do not name, and print no IMEI, serial number or MAC address.

From sources, too. The repository builds the system image from the Debian and Mobian archives, the mobile shell's git tag and its own patches: image/build-base.sh, build-mutter.sh and build-mobile.sh, then build-system.sh, about five hours on an 8-core PC under qemu-user (the steps are in the README). Such an image passes the zip, first-boot and QEMU tests but has not been installed on a phone yet, so for a phone use the system zip from Releases and build only the device zip.

From a Nura or Phosh phone

Nura builds postmarketOS images for many mainline phones, in several flavours: Phosh, GNOME Mobile, Plasma Mobile and Sxmo. Under every flavour is the same device support: a mainline kernel with the phone's device tree, the modules, the firmware, and the settings for audio, sensors and the modem. image/nura/nura-to-vibeos takes exactly that part of a Nura build and makes a Trapu device zip from it. Phosh, or whichever shell the build has, stays behind with the rest of postmarketOS's Alpine user space; Trapu brings its own, on Debian. So if your phone runs postmarketOS with Phosh today, convert its Phosh build: its kernel is the one you know works.

You need:

cd ~ && git clone https://github.com/pulpoff/vibeos
make -C vibeos/image/nura/initramfs
vibeos/image/get-update-binary.sh ~/Downloads/lineage-22.2-…-signed.zip
mkdir vibeos-6t && cd vibeos-6t
../vibeos/image/nura/nura-to-vibeos https://images.nura.eco/bpo/edge/oneplus-fajita/phosh/20261114-0517/

It downloads the build's two images and checks them against the listing's sha256. It reads them as data, without mounting or running anything, and writes three files: the device zip, its boot image, and a report. Read the report. It lists the kernel and its command line, every file carried over, and what could not be. Some postmarketOS programs have no Debian package: on Qualcomm phones q6voiced (call audio), the SIM slot selection and bootmac (the Bluetooth address) stay behind.

Checked on 2026-11-22 with the repository's converter: the OnePlus 6T's GNOME Mobile build gives the 6T zip on Releases again, every file in it the same. Its Phosh build of the same day gives the same boot image, byte for byte, and the same files; only the line that names the source build differs.

Then, on the phone. What is on its data partition now goes, postmarketOS or Android, unless you choose the image file, so save what you need first.

  1. Start LineageOS's recovery and choose Apply update › Apply from ADB. Then adb sideload the system zip from Releases and choose where Trapu goes. Whole device takes the data partition. Image file in Android data keeps Android, but only on a data partition without metadata encryption.
  2. Do not restart. Choose Apply update › Apply from ADB again, sideload your device zip, and when it asks where the boot image goes, choose Nowhere for the first try. The phone's files go into Trapu and no boot partition is written.
  3. Restart to the bootloader and start Trapu once: fastboot boot vibeos-device-oneplus-fajita_20261114-0517-boot.img. The first start grows the system, installs the device packages and restarts once by itself; then fastboot boot it again.
  4. If it works, go back to the recovery, sideload the device zip again and choose this slot's boot. What was there is saved first, in /var/lib/vibeos/device/backup/.

If it stops before the login screen, convert again with --cmdline-add vibeos.debug=1. That boot image brings up a USB network and a telnet shell at 172.16.42.1 before it looks for the system.

Before any of this touches a phone, image/nura/test/zip-test.sh runs the device zip with LineageOS's own updater on a fake disk shaped like your phone's (A/B or not; the system as a partition, nested, or an image file). It checks what was written, the backup, and that every other partition is untouched. image/nura/test/qemu-boot.sh boots the phone's kernel and the new initramfs in QEMU, to check that it finds the system. Have your agent run both.

A phone Nura has no build for needs a mainline kernel first, which is beyond these tools. image/build-device.sh shows how our own Samsung devices' zips are put together from a kernel build and firmware read from the phone's own partitions. That firmware belongs to the phone's maker: keep it off public repositories.

The brief for a ROM

For an agent making a device zip for your phone:

# A VibeOS device zip for my phone

Phone: [name]. Nura device: [e.g. oneplus-fajita]. LineageOS recovery: [how I start it].
Repository: https://github.com/pulpoff/vibeos. Read image/README.md and image/nura/README.md first.
Guide: https://vibeos.top/agents#rom

## Do
- Convert the newest Nura build of my phone (any flavour; the one I run now if it has one) with
  image/nura/nura-to-vibeos, in a new, empty folder.
- Go through the report with me: kernel, command line, what was carried over, what was not and what that breaks.
- Run image/nura/test/zip-test.sh for my phone's layout (ab or aonly) and the kind of install I will choose,
  and image/nura/test/qemu-boot.sh with the boot image. Show me every failure, not just the count.
- Write the install steps for my phone, with the way back (to Android or postmarketOS) after each step.

## Never
- Flash, erase or format anything on the phone yourself: I run every fastboot and adb command.
- Write efs, modem, persist, modemst1, modemst2, fsg or fsc, or any partition the zips do not name.
- Print or keep the phone's IMEI, serial number, MAC or Bluetooth address.
- Put anything read from my phone (partitions, firmware, backups) in a public repository or release.

Contribute

Trapu is MIT-licensed and lives at github.com/pulpoff/vibeos. Send a pull request:

Bugs and ideas go in the issues.

Rough edges, honestly

This is a young project. Where the code does not yet do what this page asks of a new app:

Each of these is a good first pull request. So is a device zip for your phone that you tested on it.