Menu

Ship a desktop Linux app as one Go binary: webview, tray, and a pacman package
πŸ“°

Ship a desktop Linux app as one Go binary: webview, tray, and a pacman package

DEV Community: goΒ·Billot_PΒ·2 days ago
#QHReZ7GC
#devtogo#devto#dev#build#desktop
Reading 0:00
15s threshold

If your product is a web UI, the usual desktop story is Electron. You ship

a browser, double the memory footprint, and keep a Node toolchain around.

That model is microslop by construction: a thin app-shaped crust over a

rented runtime, spending your users' RAM to pad someone else's platform

metrics. Linux offers a leaner route. Keep the web UI, wrap it in the

system's WebKitGTK through a webview library, add a tray icon, and package

the result with the same PKGBUILD machinery Arch uses for everything else.

The outcome is one Go binary at ~15 MB, with no bundled browser and no CGO.

This is how it's built, taken from a real app: a Go single-binary inventory

tool with a Svelte UI. Everything below compiles and runs.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.