Pure-Go implementations of the freedesktop.org specifications — no cgo, no D-Bus C library, no external tools.
go-freedesktop is a family of independent, dependency-light Go modules that
implement the freedesktop.org specifications a
launcher, file manager or desktop shell relies on — enumerating installed
applications, resolving icons, classifying files by MIME type, choosing the
application that opens a type, building the category menu, and serving desktop
notifications. Every module is pure Go, CGO_ENABLED=0, and reuses the
standard XDG base-directory resolution rather than reinventing it.
They are the desktop-integration layer beneath go-widgets launchers and shells: each spec is one small module, so a caller pulls in only what it needs.
| Module | freedesktop specification | What it gives you |
|---|---|---|
desktopentry |
Desktop Entry | Enumerate the installed applications and expand their Exec= launch commands (field codes, TryExec, actions) — the piece a dock or app menu needs. |
icontheme |
Icon Theme | Resolve an icon name (e.g. a .desktop Icon= value) to a file path at a target size and scale, following theme inheritance and the hicolor fallback. |
mime |
Shared MIME-info Database | Answer "what type is this file?" — resolve a canonical MIME type from a file's name, its content (magic), or both, against the on-disk shared database. |
mimeapps |
MIME Applications Associations | Given a MIME type, the default application and the ordered list of candidates (mimeapps.list), with round-trippable edits — the engine behind "Open With…". |
menu |
Desktop Menu | Turn applications.menu XML into a resolved, categorized tree of app entries (Accessories, Graphics, System, …) for a launcher. |
notifications |
Desktop Notifications | The org.freedesktop.Notifications D-Bus service side — decode Notify calls (notify-send, libnotify, …) and render them as go-widgets Toasts. |
secretservice |
Secret Service | Store and read secrets where the desktop already keeps them — the org.freedesktop.Secret.Service D-Bus client that GNOME Keyring and KWallet answer. The Linux half of go-keyring. |
screencast |
not a spec — X11 | Capture the pixels of displays and windows: MIT-SHM 1.2 with descriptor passing, GetImage fallback, RANDR 1.5 / XINERAMA, XFIXES cursor. Wayland is not implemented, and Diagnose() says so rather than failing obscurely. |
x11 |
not a spec — the protocol itself | The foundation every X11 client needs first: wire codec, .Xauthority, connection setup, the MIT-SHM segment, the SCM_RIGHTS transport. Shared with go-widgets/window, so one protocol parser cannot drift into two. |
The list reflects the repos that actually exist in the org today. More freedesktop layers are added over time. Two entries are marked not a spec:
x11is the X11 protocol's byte layer andscreencastis the capture built on it. They live here because they are what a Linux desktop needs next, but the column heading would be a lie if they were left blank.
- Pure Go,
CGO_ENABLED=0— one portable module per spec; cross-compiles to a static binary. - Reuse, don't reinvent — XDG base-directory resolution comes from
adrg/xdg; the later waves build on the earlier ones (mimeappsandmenustand ondesktopentry) instead of re-parsing.desktopfiles. - 100% test coverage is the bar, error branches included, on native amd64/arm64 plus emulated 64-bit targets.
- BSD-3-Clause throughout.
- 📖 Docs — https://go-freedesktop.github.io/docs/
- 🌐 Site — https://go-freedesktop.github.io/
- 🎨 Brand assets — https://github.com/go-freedesktop/brand
Branding in go-freedesktop/brand.
