How Omalauncher is put together, for anyone working on it.
An Android home-screen launcher that runs Arch Linux ARM under proot and acts as its Wayland compositor. The home screen (widgets, pinned apps, the bar and its app list) is Jetpack Compose; every Linux window opens as its own Android task, so it gets a Recents card and behaves like a separate app.
Linux is optional. Without it the launcher still has Omarchy's themes and
wallpapers, Android apps from the bar and the widgets that don't run commands.
Everything else is offered as an install from settings › linux and wherever
it appears: Linux apps, terminal widgets, coding agents, pacman and Files.
Widgets that need Linux (Program.needsLinux: cmd, stream and file sources that aren't optional, Terminal,
run/terminal/app actions, requires) show as placeholders in their cells until
it's installed. Removing Linux deletes files/arch only.
Launcher data that the guest also uses lives outside the rootfs and is bound
into it by proot (storage/LauncherData.kt), so installing or removing Linux
never touches it: files/omarchy is ~/.local/share/omarchy and
files/widgets is ~/.config/omalauncher/widgets.
Paths are under app/src/main/kotlin/dev/omalauncher/ unless they start with
a module folder; the OWL language is under
owl/src/main/kotlin/dev/omalauncher/widgets/.
- the package root: the
Application,Runtime(the one object that holds the launcher's services and wires them together), and the activities and services the manifest names (buttheme/OmarchyWallpaperServiceandwidgets/runtime/MediaListener). Their class names are public (the home-screen choice, pinned shortcuts,am start), so they stay where they are app/src/main/cpp/wlbridge.c: JNI for unix sockets with fd passing, shm mapping, per-surface pixel stores, and compositing them into a window'sANativeWindowapp/src/main/cpp/scene3d.c: a 3D scene's work per triangle, a port of the Kotlin in owl'sSpace3d.ktthat gives the same numbers (SceneNativeTest);Scene3dtakes it as itsSceneKerneland works without oneapp/src/main/cpp/mesh3d.c: building a mesh (smooth corner normals, theBsptree, reading OBJ files), in the same library; owl'sMeshKernelsholds it, set inApp, and the Kotlin it ports runs where it isn't set (MeshNativeTest). The native tests build the C for the machine they run on (HostNative) and are skipped without a compilerapp/src/main/cpp/pixels.c: frost's blur and icon masks, with the Kotlin kept as the fallback (PixelsNativeTest)app/src/main/cpp/procstat.c:ProcShim's count of CPU time, with the Kotlin kept as the fallback (ProcStatNativeTest)app/src/main/cpp/pty.candvt.c: the built-in terminal's pseudo-terminal and its screen, libghostty-vt (scripts/fetch-ghostty-vt.sh); without that librarynoterminal.cstands in and there is no built-in terminalapp/src/main/cpp/aap.c: the classic L2CAP socketandroid.airpodstalks AAP onterminal/: the built-in terminal's session, pty and screen (TerminalSession,PtyNative,Vt) and its keys;ui/terminal/draws it (NativeTerminalView, the glyph atlas, box drawing)wayland/: the Wayland server in Kotlin (wl_compositor, wl_shm, wl_subcompositor, wl_seat, wl_output, wl_data_device_manager, xdg_wm_base, xdg-decoration, KDE server decoration, and text-input-v3 for where a client's text cursor is) andWindowRenderer, which draws one window into its activity's SurfaceView (or, for a widget'sTerminal, into a TextureView in the tile)linux/: proot, the rootfs setup and its update steps, pacman, coding agents, and the bridges to Android (audio, URLs, /proc)ui/: Compose. The package itself holds what every screen shares (the palette, panels and dialogs, icons, key focus, the keyboard);home/is the home screen, the bar and its app list, folders and tiles;settings/the settings pages and first-run setup;files/Files and the editor;store/the widget store and sharing;voice/the Voice screenvoice/: what Voice runs on: its session with an agent, the agents' links, speech to text (the phone's recognizer or Parakeet) and text to speechapps/: the phone's Android apps, their shortcuts, usage and icon packsnet/: HTTPS with pinning, WebSocket, the local networkstorage/: the launcher's own data directories (LauncherData) and the phone's folders and shared storage that Files and Linux reachsystem/: small Android helpers (notifications, broadcasts, permissions, URLs and sharing, the app language)widgets/: the widget engine (render/draws nodes,runtime/holds a running widget and itsandroid.*sources); the language itself, its compiler (lang/) and the store's checks (market/) are in theowlmodule. A widget's state and sources live in itsWidgetInstance, which runs while its page or a neighbour is on screen, but the pager composes only the current page: a node drawn in Kotlin loses itsrememberstate when its page is swiped away, and keeps anything lasting in the instancetheme/: Omarchy themes, applied to the launcher and the guestupgrade/: how installs follow app updates (see below)
A client's commit copies only the damaged rectangles of its shm buffer into
the surface's pixel store, outside the server lock, and hands the buffer back
right away. Each window's WindowRenderer runs on its own thread: at vsync it
snapshots the surface tree, redraws only the dirty region of the SurfaceView
(everything, if a surface moved or appeared), posts, and then sends the frame
callbacks. The SurfaceView has a few buffers that take turns, and the whole
window is locked each time: locking only the dirty region makes Android copy
the rest of the frame from the buffer on screen, which cost more than the
drawing. BufferDamage keeps what each buffer missed while the others were
drawn, and that is what gets repainted. Hidden windows get no frame callbacks, so their clients stop
drawing.
A widget's Browser node draws an Android System WebView inside the tile
(ui/BrowserView.kt), not a client of the Wayland compositor. Nothing runs in
the guest, so a file with a Browser needs no Linux, and its frames go into the
tile the way any other view's do. What the page may reach is decided there and
nowhere else: https only, no file or content access, script and DOM storage only
when the node asks for js, and no JavaScript bridge. Every Browser in the app
shares one WebView profile, so cookies and sign-ins are shared between tiles.
Home's input owner, TerminalTiles, takes a Browser tile in as it takes a
terminal: the page's view takes no touch until the tile is tapped
(TileWebView.dispatchTouchEvent says so), so a swipe still turns the page and
a long press still lifts the tile. The tap that gives it the tile, a tap
outside it, a page turn and Back are the same code path a terminal's and a
widget's text field are, and the page is what the home screen lifts above the
keyboard. A field in the page keeps the WebView's own IME connection.
Opt-in, in settings › linux. The device node picks the driver. Mali (v10+:
Pixel 7 and newer, recent MediaTek) uses the pinned PanVK-kbase driver on
/dev/mali0, from zenithblue-oss/panvk-kbase-android. Adreno 6xx and newer
use the pinned Turnip KGSL driver on /dev/kgsl-3d0, the Arch
vulkan-freedreno package from lfdevs/mesa-for-android-container
(turnip-26.3.0-devel-20260824). The model comes from
/sys/class/kgsl/kgsl-3d0/gpu_model. An older Adreno, or a model that cannot
be read, is not offered. Arch's own Mesa talks to DRM, so it would not see
/dev/kgsl-3d0. Both blobs are checked against their sha256 and installed
under /usr/local, and both ICD manifests live under
/usr/local/share/vulkan/icd.d, which pacman does not own. A download that
fails deletes its temp files on the way out. Turning one on also installs
Mesa and the Vulkan loader with pacman. OpenGL is zink. On both Adreno and Mali the guest
uses a patched Mesa 26.2.4 (scripts/mesa/0001-egl-wayland-keep-zink-on-shm.patch, and
0002-zink-acquire-swapchain-resolve-before-use.patch for zink acquiring a swapchain image it hasn't):
the compositor only offers wl_shm, stock Mesa clears zink after the Wayland
DRM path fails, and the shm buffer stays black while frames still count.
MESA_LOADER_DRIVER_OVERRIDE=zink keeps zink set so kopper presents through
Vulkan WSI. The patched libraries live under /usr/local/omalauncher-mesa,
off the default linker path. Frames still arrive as wl_shm buffers
(MESA_VK_WSI_DEBUG=sw), so the compositor is the same either way.
linux/Gpu.kt only switches guest apps to the GPU (Proot.graphicsEnv)
after a check passes (vulkaninfo finds PanVK or Turnip, eglinfo gets zink),
and checks again after every system update; if that fails, the ICD manifest
is removed and apps render in software (llvmpipe). Software mode sets LIBGL_ALWAYS_SOFTWARE=1, and VK_ICD_FILENAMES and VK_DRIVER_FILES to
lavapipe's manifest alone (LAVAPIPE_ICD), so the loader does not scan the default ICD
directories and a GPU driver left behind can't be picked, while Vulkan apps still run on the CPU. The loader prefers VK_DRIVER_FILES, so turning the GPU on
sets both names to the real manifest. The check unsets the software values
before it exports those. Settings offers a
retry. One app can opt out with GALLIUM_DRIVER=llvmpipe app. Terminal apps
(foot) draw on the CPU and
don't change.
The app writes into the rootfs and keeps state of its own, so an update must reach existing installs without breaking them. There are four mechanisms:
- Rootfs steps (
linux/Bootstrap.kt): an ordered list of idempotent steps (/etcconfiguration, packages, the keymap, cliamp). Each one's id is recorded once it succeeds (files/rootfs-steps.json). To change what a step does on existing installs, give it a new id, for examplepackages-1→packages-2after changing the package list. A fresh install runs every step in the background, with progress in settings › linux and the notification. After an update, new offline steps before the first pending network step run before Linux starts, and steps that need the network run in the background. Their progress and failures show in settings, and they retry on the next start. - Launcher-provided files (
upgrade/ManagedFiles.kt): shims, desktop entries, default configs, default widgets, the style defaults and the widget docs. Every file written is recorded with its hash: the launcher's own (default widgets) infiles/launcher-managed.json, the guest's infiles/managed.json, which only syncs while Linux is installed and is forgotten with it.Ownedfiles (plumbing) always match the APK.Seededfiles are defaults the user may edit. They are updated only while unchanged since we wrote them, and never brought back once deleted.- Files dropped from the APK are deleted if they're unchanged.
- The sync runs on every start and only hashes files when nothing changed.
- Saved data (
upgrade/Versioned.kt): preferences and JSON files are stored as{"v": N, "data": …}. A format change bumpsNand adds a migration step to the reader. Entries are parsed one at a time, so a bad one is skipped instead of losing the rest. - Widgets:
Compiler.LEVELin the owl module is the language version. Widgets that need a newer one declaremeta { owl: N }, and store entries carry it. An older launcher then shows "needs a newer launcher" instead of failing. Bump the level with every addition a widget could depend on. The store'sindex.jsonformat number only changes for incompatible changes.
System updates (linux/SystemUpdates.kt) are the user's own: pacman
packages and the tools mise installed (the coding agents). The launcher
checks at most every 6 hours while it's on screen: pacman against a private
copy of the databases in /tmp, so the real ones and pacman's lock are
untouched, plus mise outdated. When updates are pending, a dot shows on the
app list's settings gear. "update all" in settings runs pacman -Syyu and then
mise upgrade as one job. Nothing updates automatically.
The launcher itself updates through whatever installed it. The play
build flavor asks Google Play when settings opens (LauncherUpdates.kt in
app/src/play) and lists a newer version in the same updates box; its
"update" opens Play's own update screen. The foss flavor (GitHub releases,
F-Droid) has a twin of that class without Play's closed-source library: it
asks GitHub's releases API instead (at most hourly) and "update" opens the
release page. Installs made by an F-Droid client never ask; F-Droid updates
them.
Pinned versions: ThemeStore.OMARCHY_REF (the Omarchy commit) with
ThemeStore.BACKGROUNDS_REF (the omarchy-themes-backgrounds commit, where the
themes' backgrounds live since Omarchy 4.6), and CLIAMP_VERSION in
Bootstrap.kt. Changing either of the first two makes every install
download the new themes on its next start (ThemeStore.ensureRelease, with or
without Linux); rerun scripts/fetch-theme-colors.sh with it, since first run
fetches only the picked theme's colors and first background by the names that
script bundles, and the download fetches the files it lists in
assets/omarchy-files.txt one by one (about 80 MB, where the repo's tarball
is 180), keeping what arrived across interrupted attempts. Changing CLIAMP_VERSION updates Linux installs through the steps
above.
Guest processes die with the app, so the Wayland protocol, the socket and the
guest environment carry no state across an update. A guest command's leftover
children die when it exits (--kill-on-exit), except an app's, whose command
may only start it (Proot.process, Runtime.launchApp).
Settings › Linux can stop an installed Linux (Runtime.stopLinux): every
guest process is killed, the foreground service goes, and Proot.process
refuses to start another until it's started again. The linux_stopped
preference keeps it stopped across restarts; meanwhile the Wayland server and
the bridges stay up, and whatever needs Linux opens its settings.
voice/Speech.kt turns speech into text for Voice, the prompt bar and
widgets' dictation. It listens with Parakeet (Parakeet.kt) when the user has
downloaded it in the voice settings and the language is one of its 25;
otherwise with the phone's recognizer: Google's on-device one first, then the
default RecognitionService, then a "speak now" screen. Parakeet is NVIDIA's
Parakeet TDT 0.6B v3 run by sherpa-onnx on the CPU: the launcher records the
microphone itself, Silero VAD splits phrases and each is decoded whole, with
the unfinished phrase decoded again for the live text. ParakeetModel.kt
downloads its 670 MB (resumable, SHA-256 checked) into noBackupFilesDir.
sherpa-onnx isn't on Maven: scripts/fetch-sherpa.sh builds its AAR from
source into the gitignored app/libs, linked against onnxruntime's Android
release. The model loads on a tap with the microphone
already open, and stays loaded while Voice is in sight.
The app has two build flavors. foss (GitHub releases, F-Droid, the default)
may do what Google Play doesn't allow: it asks for permissions Play restricts,
like the call log. play is what goes on the Play Store. Apart from the
updater (see Updates), both builds run the same code:
- The manifest decides. A permission only the foss build has goes in
app/src/foss/AndroidManifest.xml, which Gradle merges over the main one. Code checkscontext.declares(permission)(system/Permissions.kt) and does without it when it isn't declared. Code never checks the flavor (BuildConfig.FLAVORis only for announcements aimed at one build). - Play's permissions are listed.
app/play-permissions.txtlists every permission the play build asks for, libraries' included.checkPlay<Variant>Permissionscompares it with the merged manifest and failsassemble,bundleandlintof a play variant when they differ, so a restricted permission can't reach Play by mistake. A change to that file is a change to the Play listing's permissions. - Widgets are the same in both. Widgets move between the builds through the
store, so OWL and its level don't change between them. What the play build
can't do shows up as data that isn't there (
android.calls'logis false), the way a permission the user refused does. The widget docs say which fields only the foss build fills. - Settings follow the manifest. The permissions screen shows a row only for a permission the build declares.
A flavor-specific class (app/src/foss and app/src/play) is only for code
the other build can't ship, like Play's closed-source update library.
Each recipe lists what a complete change touches. Tests go next to the code
they cover, in owl/src/test or app/src/test.
- A coding agent: an
Agententry inlinux/Agents.kt(with anOwnInstallerwhen mise has no package for it, like Hermes); its description aslinux_agent_<id>in everystrings_linux.xml; an SVG inart/icons/, turned into PNGs byscripts/make-icons.sh; anactivity-aliasinAndroidManifest.xmlso its window gets its own icon and label; a case inAgentsTest. Voice talks to it only with an entry invoice/AgentLink.kt. - OWL syntax, a node or a builtin: the compiler in
lang/(Schema.ktfor what's allowed where, plusSINCEwith the level,Compiler.kt,Builtins.kt); drawing inwidgets/render/; state inwidgets/runtime/WidgetInstance.kt; the page inassets/widgets/docs/and the line indocs/versions.md;LangTest. See AGENTS.md for when to bumpCompiler.LEVEL. - An
android.*source for widgets: a file inwidgets/runtime/, wired inWidgetServices.ktandWidgetInstance.kt; its name in the compiler as above;assets/widgets/docs/android.md. If it reads something private, add a warning tomarket/Review.ktso store reviewers check the widget, and update the privacy policy (store/omalauncher.txt). A new Android permission is asked throughui/AskPermission.ktand listed on the permissions screen (ui/settings/PermissionsScreen.kt). It goes inapp/play-permissions.txttoo, or, if Play restricts it, inapp/src/foss/AndroidManifest.xmlonly (see Two builds). - A stock widget (
assets/widgets/*.owl): these areSeededfiles, so an edit reaches every install that hasn't changed its copy. Raise theversionin itsmeta { }and keep itsstrings { }sets in every app language. - An
omalaunchercommand (the guest's way to the phone): the scriptassets/omalauncher.sh(its usage text and the argument check in its lastcase), the answer inlinux/PhoneBridge.kt(thewhen (args[0])andCOMMANDS, whichomalauncher versionlists), the paragraph about it in the guest's AGENTS.md (WidgetEngine.kt) and the README.OmalauncherScriptTest.commandsAgreefails until the script, its usage andPhoneBridgelist the same commands. Errors go back asusage:,denied:orerror:answers, which the script turns into exit codes 2, 3 and 1; keep those meanings, since scripts depend on them. Commands never ask for permissions. - UI text:
res/values/strings_<area>.xmland the same key in eachvalues-*folder. - A message to users (a contest, news): no app change. Edit
announcements.jsonin the omarchy-widgets repo, published next to the store's catalog; settings shows it once in a dialog (net/Announcements.kt,ui/home/AnnouncementDialog.kt). Old launchers read new files, so only add fields; a message that needs a newer launcher setsminVersionCode. Times need theirZ. A debug build readsfiles/announcements.jsoninstead. - What Linux gets set up with: a rootfs step in
linux/Bootstrap.kt(a changed step needs a new id), or a file the launcher writes, listed in amanaged()list (like the one inlinux/Agents.kt, collected inRuntime.kt), synced byupgrade/ManagedFiles.kt. See "Updates" above. - A saved format (preferences, JSON in
files/): it is stored throughupgrade/Versioned.kt: bump its version and add a migration; never drop the old reader.