ActionUI renders its JSON documents on Linux as native GNOME interfaces: GTK 4 and libadwaita widgets, written in Swift and built from the same Swift package as the Apple frameworks. A document written for macOS opens on Linux unchanged, with the same element and property names, the same values and actions, and the same C interface for host programs.
For how the renderer works (retained widgets, SwiftUI's layout reproduced, what is shared with Apple) see the Linux section of Architecture.md.
-
GNOME 48 or later: GTK 4.18, libadwaita 1.7, GLib 2.84 and libsoup 3. Tested on Debian 13 (GTK 4.18, libadwaita 1.7) and Ubuntu 26.04 (GTK 4.22, libadwaita 1.9). Ubuntu 24.04's libadwaita 1.5 is too old.
-
To build: a Swift 6.3 or later toolchain from swift.org, and the development packages (Debian and Ubuntu names):
sudo apt install libgtk-4-dev libadwaita-1-dev libsoup-3.0-dev pkg-config
-
For a Linux virtual machine on a Mac:
agent-vm/swift-gtkis an agent-vm image recipe that installs all of the above on Debian 13 or Ubuntu 26.04 (ARM). It installs swift.org's toolchain for the system it runs on into/usr, refusing a download not signed by the Swift 6.x release key; theswift,platform,signed_byandsha256parameters choose another release, build or key, or pin the download. Add a desktop recipe (Recipes/linux-gnome) to run the apps on the box's screen:agent-vm image create swift-gtk --linux ubuntu-26.04 --recipe ActionUIAdwaita/agent-vm/swift-gtk/recipe.json agent-vm image create swift-gtk-gnome --from swift-gtk --recipe <agent-vm>/Recipes/linux-gnome/recipe.json
-
At run time, besides GTK, libadwaita and libsoup:
- glib-networking for https URLs (installed with GNOME);
- WebKitGTK 6.0 (
libwebkitgtk-6.0-4) for WebView only. It is loaded when a WebView is first shown, so it is a dependency of the app that shows web pages, not of ActionUI; without it a WebView shows a placeholder that names the package. Ubuntu's desktop installs it; Debian's GNOME desktop does not. - libshumate (
libshumate-1.0-1, GNOME's map widget) for Map only, loaded when a Map is first made, so it too is a dependency of the app that shows maps; without it a Map shows a placeholder that names the package. GNOME Maps depends on it, so a desktop with GNOME Maps has it. - GStreamer for VideoPlayer: built into GTK 4.20 and later, a GTK module before that (
libgtk-4-media-gstreamer, which Debian's GNOME desktop installs), plus the GStreamer plug-ins for the video's format; - ICU (any version the system has) for dates and numbers by locale, also loaded when first needed.
From the repository root, on Linux:
Scripts/prepare-linux-symbols.sh # the symbol icons; again when a map or font changes
swift build # ActionUI
swift run --package-path Apps/ActionUIViewer --only-use-versions-from-resolved-file --manifest-cache none \
ActionUIViewer ActionUISwiftTestApp/Resources/Form.json
swift run --package-path ActionUIAdwaita/Apps ActionUIAdwaitaDemo --resources ActionUISwiftTestApp/ResourcesSF Symbols are shown as Material Symbols icons, and Fluent System Icons ones for the names Material lacks, which Scripts/prepare-linux-symbols.sh generates from the two fonts (downloaded on its first run) and compiles into ActionUI, as a GResource in a section of its own: libActionUI.so and every Swift program that links ActionUI statically carry it (gresource list shows it). Run the script before the first build, and again when sf_to_material.map, sf_to_fluent.map or a font changes; bash Tools/material_symbols/fetch-material-symbols-font.sh moves to a newer font release. A build without the icons succeeds but warns at its top on every build, and its SF Symbols show the missing-icon picture. A Swift package that depends on ActionUI runs the script in its ActionUI checkout first (.build/checkouts/ActionUI, or the folder of a path dependency).
- ActionUIViewer (
Apps/ActionUIViewer, one package for macOS, Linux and Windows) opens one document in a window: a path, a file URL or an http(s) URL.--darkuses the dark style;--screenshot out.pngsaves the window as an image once it has drawn and quits (drawn by the window itself, so no screen capture is needed);--rows <id> <rows.json>fills a List, Table or Chart for a screenshot. Its package'sPackage.resolvedalso lists packages only macOS uses:--only-use-versions-from-resolved-filekeeps a Linux build from dropping them, and--manifest-cache nonekeeps the root package's file list current. - ActionUIAdwaitaDemo is the Linux counterpart of ActionUISwiftTestApp: a launcher of all the test app's documents and the documents of the add-ons that work on Linux, with the test app's own action handlers.
--open <Name>also opens one document at launch,--screenshotsaves it.
A self-contained demo, which runs where Swift is not installed:
swift build -c release --static-swift-stdlib --package-path ActionUIAdwaita/Apps --product ActionUIAdwaitaDemo
Scripts/make-linux-demo-bundle.sh ActionUIAdwaita/Apps/.build/release /tmp # makes /tmp/ActionUIDemo.app
/tmp/ActionUIDemo.app/ActionUIDemo
Scripts/linux-app-entry.py install /tmp/ActionUIDemo.app # optional: the demo in the desktop's app listActionUIDemo.app is a plain folder: the program, stripped (about 17 MB), beside its documents and images, its Info.plist and its icon (both from ActionUIAdwaita/DemoBundle), and the test app's asset images in Assets/. The program finds its documents in the folder it runs from (below, "An app's own files").
Linux has no app bundles and no asset catalogs. An ActionUI app ships as a plain folder holding its program and its files, named MyApp.app by the convention carried over from Apple (the name is not required), and ActionUI looks for the app's own files there, never in the current folder:
MyApp.app/
MyApp the program (or, for Python and Node.js, the main script)
Info.plist the app's ID, name, icon, version (below, "Info.plist")
MyApp.svg the icon Info.plist names
Main.json, Settings.json, sheet.html, userscript.js, photo.png ... the resources
Assets/ the app's asset images, each file named after its asset
Orb.png, Logo.svg ... (named in the JSON as "Orb", "Logo")
- Resources are named in the JSON by their whole file name, extension included, as on Apple and Windows: a LoadableView's
"name": "Settings.json", an Image's"resourceName": "photo.png". A WebView user script'sresourceNameis the one exception: as on Apple,.jsmay be left out ("resourceName": "userscript"findsuserscript.js). A LoadableView's name is looked for first beside the JSON that holds it (the file an enclosing LoadableView loaded, else the window's own file), then in the app's folder; other resources only in the app's folder. - Assets are named in the JSON without an extension, as an asset in an Xcode asset catalog is: an Image's
"assetName": "Orb", a Button's, Label's or Tab's"assetImage": "Orb", a Canvas image'sassetName. On Linux the asset is the image file of that name in theAssetsfolder,Assets/Orb.pngorAssets/Orb.svg, the same folder Windows uses. TheAssetsfolder is put on GTK's icon theme search path, so an asset is an icon of the theme:- The icon theme reads PNG, SVG and XPM files; a JPEG or another format in
Assetsis not found on Linux, though Windows shows it. - The name is matched with its case (
"orb"does not findOrb.png), where Windows ignores case; and it is given without the extension ("Orb.png"finds nothing). - An asset is drawn as an icon, at the size of a symbol in the same place, whatever its pixel size: in an Image, 1.1 em of its font (0.9 and 1.4 em with imageScale small and large), in a button 16 pixels, in a tab the switcher's size. On Apple an asset image is drawn at its own size, so an Image showing a larger picture from
Assetsisresizablewith aframeon Linux, which scales it to the frame; or the picture is a resource (resourceName), which is drawn at its pixel size. - A file whose name ends in
-symbolic(Assets/Star-symbolic.svg, named"Star-symbolic") is recolored with the text color, as GTK recolors symbolic icons; other files keep their colors. - A name the app has no image for is an icon of the desktop's icon theme when the theme has one (
"folder"shows the theme's folder), else the missing-image symbol; a Canvas draws nothing for it, and a tab shows the missing-image symbol. - An image file at the app's top level is a resource, not an asset:
"assetName": "photo"does not findphoto.pngthere. - The app's icon given in code by name (
actionUIAppSetIcon("MyApp")and its counterparts) is looked up as an asset, inAssets, then in the desktop's icon theme;CFBundleIconFileinInfo.plistnames a file beside it instead.
- The icon theme reads PNG, SVG and XPM files; a JPEG or another format in
- A name with a folder in it (
a/b.json,../b.json) finds nothing. - These folders are also the app's own files for the trust policy: ActionUI JSON loaded from the app's folder is trusted, as the app's own, and its WindowGroup commands join the menu.
The macOS layout. An app folder may also have the macOS bundle layout, one folder for both systems: the Linux program in Contents/Linux, the resources in Contents/Resources, and Info.plist in Contents, which is found there by itself. The resources are not: the program names Contents/Resources as its resource folder (below), and the assets are then in Contents/Resources/Assets. Without that, both are looked for in Contents/Linux, the program's folder.
A host that names its resource folder. A program whose files are elsewhere, or a host whose program is an interpreter (python3, node, whose folder must never be searched or trusted), names the folder itself, before the first window loads. That folder is then used alone, in place of the program's, and its Assets folder holds the assets:
| Host | How it names the folder |
|---|---|
| Swift | AdwaitaApplication.shared.resourceFolder = path |
| C, C++ | actionUIAppSetResourceFolder(path) (ActionUIApp.h), or actionUISetConfigurationJSON("{\"resourceFolder\": ...}") (ActionUIC.h) |
| Python | actionui.Application(resource_folder="ui"); without it, the main script's folder |
| Node.js | new actionui.Application({ resourceFolder: path.join(__dirname, 'ui') }), or actionui.configure({ resourceFolder }); without it, the main script's folder |
| Rust | app.set_resource_folder(Some(path)) (App) |
An app describes itself in an Info.plist, the same file and keys as an Apple bundle's. It is at the app folder's top level (the flat layout: the program's folder, or for Python and Node.js the main script's, the resource folder), or in Contents when the app has the macOS layout (the program in Contents/Linux, its resources in Contents/Resources):
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleIdentifier</key>
<string>org.example.MyApp</string>
<key>CFBundleDisplayName</key>
<string>My App</string>
<key>CFBundleIconFile</key>
<string>MyApp</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2026 Example</string>
</dict>
</plist>CFBundleIdentifier: the reverse-DNS application ID. The desktop matches the app's windows to its desktop entry,<CFBundleIdentifier>.desktop, by it, so the dock shows the entry's name and icon; with no matching entry it shows the raw ID and a generic icon.CFBundleDisplayName, elseCFBundleName: the application's name, in the About item and dialog of the windows' primary menu, and the title of a window that has none of its own (a document file's window takes the file's name).CFBundleIconFile: the windows' icon, a file name in the resources with its extension optional. GTK reads no.icns, so on Linux the name is looked for asMyApp.svg, thenMyApp.png(or the file named, when it is an SVG or a PNG): one plist serves both systems, withMyApp.icnsbeside the SVG for macOS.CFBundleShortVersionString, elseCFBundleVersion: the version the About dialog shows.NSHumanReadableCopyright: the copyright line the About dialog shows.
All keys are optional; an empty string counts as left out. A value the program sets in code (actionUIAppSetApplicationID, actionUIAppSetName, actionUIAppSetIcon and their Python, Node.js, Rust and Swift counterparts, and, in Swift only, AdwaitaApplication's version and copyright) wins over the file; with neither, the ID is made from the name (com.abracode.actionui.<name>). Other keys are left for the tools that install the app.
Scripts/linux-app-entry.py adds an app folder to the app list of the desktop (GNOME's Apps, KDE Plasma's launcher, Xfce's menu and others that follow the freedesktop.org standards), for the current user, from its Info.plist:
Scripts/linux-app-entry.py install /path/to/MyApp.app # runs MyApp.app/MyApp
Scripts/linux-app-entry.py install /path/to/MyApp --exec 'python3 MyApp.py %U' # a Python or Node.js app
Scripts/linux-app-entry.py uninstall /path/to/MyApp.app # or: uninstall org.example.MyAppIt writes ~/.local/share/applications/<CFBundleIdentifier>.desktop and copies the icon into the user's icon theme as <CFBundleIdentifier>.svg or .png (a square PNG of a standard size: 48, 64, 128, 256, 512 and others; an SVG serves every size). It needs CFBundleIdentifier; the entry runs CFBundleExecutable in the program folder (the app folder, or Contents/Linux), else the executable named after the app folder. Two keys only Linux reads go into the entry, and macOS ignores them:
<key>LinuxDesktopComment</key>
<string>Edits my things</string>
<key>LinuxDesktopCategories</key>
<array>
<string>Utility</string>
</array>The files and folders the app opens are its CFBundleDocumentTypes, as on macOS: the entry lists them as MIME types (MimeType), so the file manager's Open With offers the app for them, and the entry's command line ends in %U, which hands the app the chosen files as file:// URLs. Each document type's CFBundleTypeMIMETypes is taken as given; its LSItemContentTypes (such as public.plain-text, public.folder, com.apple.application-bundle) and CFBundleTypeExtensions (txt, png) are turned into MIME types; a type whose CFBundleTypeRole is None is left out, and CFBundleTypeOSTypes, legacy Mac OS file types, are not read. * (any file) is not listed, and neither are public.item, public.data and public.content (any file or item): as application/octet-stream (and inode/directory) they would make the app the default for every file the desktop cannot type further and for every folder, so an app that takes any file names the types it should be offered for. The URL schemes in CFBundleURLTypes are listed as x-scheme-handler/<scheme>, so a link with the scheme opens the app with the URL, as on macOS. A Linux desktop types every folder inode/directory whatever its name, so an app that opens bundles is offered for every folder. For what these cannot say, a Linux-only array adds MIME types as given:
<key>LinuxMimeTypes</key>
<array>
<string>application/x-example</string>
</array>The desktop picks the entry up within seconds. A changed command line is another matter in GNOME: GNOME Shell can keep starting the program the entry named before, until the entry is uninstalled, some seconds pass, and it is installed again (or the next login). A changed icon is another matter in GNOME: its Apps grid can keep showing the icon it first drew until the next login, even after the entry is uninstalled and installed again, while the dock shows the new icon at once. --exec takes the entry's command line, run in the app folder; without it the entry runs the app's program (CFBundleExecutable, else the executable named after the app folder, else the only executable in the program folder). macOS .icns and Icon Composer files do not work on Linux: export a PNG or an SVG (with neither, the entry gets the desktop's generic icon, and the script says so).
actionui-verify checks ActionUI JSON documents against the element schemas, with the same options, output and exit codes as on macOS and as the Python verifier in Tools/verifier. It needs no GTK, so it also runs on a machine with no desktop:
swift run --package-path Apps/ActionUIVerifier actionui-verify -r ActionUISwiftTestApp/ResourcesA self-contained copy, which runs where Swift is not installed:
swift build -c release --static-swift-stdlib --package-path Apps/ActionUIVerifier
Scripts/make-linux-verifier-package.sh Apps/ActionUIVerifier/.build/release <output folder>The script makes actionui-verify-<version>-linux-<arch>/ and its .tar.gz: the stripped tool in bin/, the element schemas and the add-ons' in share/actionui/schemas/. Unpack it anywhere; it needs only the C and C++ libraries, no older than those of the machine that built it (a build on Debian 13 needs glibc 2.38; one on Ubuntu 26.04 needs glibc 2.43, which gave float math functions such as sqrtf new versions).
swift testThe renderer tests open real windows, so they need a graphical session (Wayland or X11); without one they skip themselves. The layout tests compare frames with recordings taken from SwiftUI (LayoutParity/).
The viewer and the demo have tests of their own in their packages, which run the programs themselves:
swift test --package-path Apps/ActionUIViewer --only-use-versions-from-resolved-file --manifest-cache none
swift test --package-path ActionUIAdwaita/AppslibActionUI.so has tests of its own, Python programs run against the built library, in the package that builds it:
swift build --package-path ActionUIAdwaita/Library
swift test --package-path ActionUIAdwaita/Library-
Swift: depend on the ActionUI package's
ActionUIStaticproduct, which links the sameActionUImodule into the program. That module holds the portable core and the GTK renderer. A program that lets ActionUI run its application also depends on theActionUIAdwaitaApplicationproduct (import ActionUIAdwaitaApplication), whereAdwaitaApplicationruns an application and presents documents andAppPanelsshows the alert and the file panels; a program that runs its ownGtkApplicationleaves it out, as an AppKit host on macOS leaves outActionUIAppKitApplication. The Swift adapter (ActionUISwiftAdapter), which offers the same calls as on Apple, is a target of the package, for the programs inside it such as the demo; it is not a product on Linux yet. Swift programs compile ActionUI in and use the toolchain's Swift runtime; they do not loadlibActionUI.so, which carries a second, private Swift runtime and libdispatch (its main queue would not be the program's). -
C, Python, Node.js, Rust and other languages: load
libActionUI.so, which holds the renderer, the add-ons (RichText, CachedImage, Diff and HostSurface, registered before the first document loads, so a document just uses them), the C adapter (ActionUIC.h) and the application functions (ActionUIApp.h), with the same names and signatures as on macOS. Built with the Swift runtime inside it, it needs no Swift installation:swift build -c release --static-swift-stdlib --package-path ActionUIAdwaita/Library --product ActionUI Scripts/make-linux-library-package.sh ActionUIAdwaita/Library/.build/release <output folder>
The script makes
actionui-<version>-linux-<arch>/and its.tar.gz: the stripped library inlib/, the licenses (LICENSE.txt,LICENSE-MaterialSymbols.txtandLICENSE-FluentSystemIcons.txtfor the symbol icons, andLICENSE-RichText.txt,LICENSE-AsyncImageCache.txtandLICENSE-DiffView.txtfor the packages linked in, andLICENSE-Swift.txtfor the Swift runtime linked in), apkg-configfile (lib/pkgconfig/actionui.pc, valid wherever the folder is unpacked), and the headers at the include paths the Apple frameworks use (<ActionUICAdapter/ActionUIC.h>,<ActionUIAppKitApplication/ActionUIApp.h>, and the remote server's<ActionUIRemote/ActionUIRemote-Swift.h>, the one Swift generates). It is a build input, not an installation: each program ships its own copy oflibActionUI.sobeside its binary (for Python and Node.js, beside the compiled extension) and links with-Wl,-rpath,'$ORIGIN', so it stays self-contained, as an app bundle is on macOS. A host that loads the library by path, asctypesdoes, needs no link flags.Library/Tests/ActionUILibraryTests/Hosts/temperature_converter.pyis a complete Python host using onlyctypes. The Python and Node.js packages and the Rust crates build on Linux against the library package (ActionUIPython/BUILD_GUIDE.md,ActionUINodeJS/BUILD_GUIDE.mdandActionUIRust/BUILD_GUIDE.md, "Building on Linux").
- Elements: every core element type. All but a few of the test app's 108 documents render with nothing missing.
- Map: OpenStreetMap's standard tiles through libshumate, with the attribution OpenStreetMap requires, a scale, zoom buttons and a compass. The value, both actions and
interactionModeswork, and each annotation is a red pin with its title and subtitle under it, andshowsUserLocationshows the user's location from the desktop's location portal.Documentation/Schemas/Map.mdlists what differs. - Chart: draws every mark with axes, legends and series colors, comparable to Swift Charts. Selection (by the pointer, as on macOS), scrolling and annotations work;
Documentation/Schemas/Chart.mdlists what differs. - ShareLink: Linux desktops have no share sheet, so its button opens a menu of the ways GNOME shares a link: Copy Link, and Send by Email..., which opens the user's mail program with the subject, the message and the URL (through the desktop's Email portal, else a
mailto:link). When no email app can be opened, an alert says so. - Application functions (
actionUIApp*): windows, the lifecycle handlers, the resource folder and the menu bar's commands (in each window's primary menu) work. The standalone alert and the open and save panels are libadwaita's alert dialog and GTK's file dialog, modal to the active window; each call blocks until the user answers while the main loop keeps running, and takes the macOS configuration keys, ignoring those GTK has no counterpart for (an alert'sstyle, a panel'smessage,showsHiddenFiles,treatsFilePackagesAsDirectories,canCreateDirectories; a panel allowing files and folders chooses files). Called before the application runs, they log why and return NULL. The remote server (ActionUIRemote/PROTOCOL.md) runs as on macOS, its socket by default in$XDG_RUNTIME_DIR(else$TMPDIR, else/tmp);actionui.contentSizeLimitsmeasures a window on screen (ActionUIModel.contentSizeLimits, null for a window that is only loaded), as do the C functionactionUIGetContentSizeLimitsand the Python, Node.js and Rustcontent_size_limitsover it. - Add-ons: RichText, CachedImage, Diff and HostSurface are in
libActionUI.so, and work in a Swift program that links them and registers them (Add-ons/README.md), as the viewer and the demo do. Chat and QuickLook are not on Linux yet. An element without a renderer shows the placeholder. - Look: libadwaita's controls, header bar and dark style. SF Symbols may not be shipped off Apple platforms, so SF Symbol names show the Material Symbols Rounded icons Android and Web show, from the same map (
sf_to_material.map), at each symbol's fill and weight, in the text color. A name that map lacks shows the closest Fluent System Icons glyph (Tools/fluent_symbols/sf_to_fluent.map), as on Windows, regular (unfilled) ones with their strokes thickened to match Material's; a name neither map has shows the missing-icon picture. The icons are compiled into the library; their licenses areLICENSE-MaterialSymbols.txt(Apache 2.0) andLICENSE-FluentSystemIcons.txt(MIT) in the library package and the demo bundle. The controls' own icons (menus, the sidebar button, steppers) stay Adwaita's, as in other GNOME apps. - Closing the last window: the user's close ends the application (after asking the shouldTerminate handler), as GNOME applications do: with no window, a Linux application has no Dock icon or menu bar to quit it from. The host's close (
closeWindow) leaves it running, as on macOS, until the host presents another window or callsterminate, so a host can close one window before it opens the next.
| Folder | What |
|---|---|
Sources/Elements |
one renderer per element type (Button+Adwaita.swift, ...) |
Sources/Layout |
SwiftUI's layout reproduced: stacks, grids, frames, scroll views, modifier boxes |
Sources/Runtime |
the render tree, the window registry, toolbars, the primary menu, presentations |
../ActionUIAdwaitaApplication |
the optional application module: AdwaitaApplication, AppPanels, offscreen rendering, and the actionUIApp* C functions |
Sources/Styling, Formatting, Markdown, Drawing |
CSS for colors and fonts, number and date formats, markdown text, shapes |
../ActionUIRendererShared |
renderer code with no GTK in it, shared with other renderers and tested without a display: the stack and frame solvers, the inherited environment, screen titles and hover presence, and the chart layout, which turns the Core chart model into drawing primitives |
Sources/Interop |
the Swift side of the GTK, GLib and WebKitGTK C APIs |
CAdwaita, CSoup |
the system libraries' headers, with the version floors |
CLinuxSocket |
accept4, which Swift's Glibc module leaves out (for the remote server) |
CSymbolResource, Plugins/SymbolResourceCheck |
the symbol icons as a GResource section (the C source Scripts/prepare-linux-symbols.sh generates, in generated/), and the build plugin that warns when they are missing or out of date. The generator, Tools/material_symbols/generate-symbol-icons.c, draws Material Symbols Rounded glyphs with HarfBuzz as symbolic SVGs from ActionUIAndroid's sf_to_material.map, and Fluent System Icons glyphs from Tools/fluent_symbols/sf_to_fluent.map for the names Material lacks; the SVGs stay in Tools/material_symbols/build/icons for inspection |
Apps |
ActionUIAdwaitaDemo, a package of its own that links the add-ons, with its tests (the viewer is in Apps/ActionUIViewer) |
Tests |
the renderer, layout and application tests |