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. |
The list reflects the repos that actually exist in the org today. More freedesktop layers are added over time.
- 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.
