go-freedesktop

The freedesktop.org desktop-integration layer, in pure Go. No cgo, no D-Bus C library, no external tools.

CGO_ENABLED=0 6 specs XDG-native 100% coverage BSD-3-Clause

go-freedesktop is a family of small, independent 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 which application opens a type, building the category menu, and serving desktop notifications.

Every module is pure Go, CGO_ENABLED=0, reuses standard XDG base-directory resolution instead of reinventing it, and cross-compiles to a static binary. Each spec is one small module, so a caller pulls in only what it needs. They are the desktop-integration layer beneath go-widgets launchers and shells.

Why go-freedesktop

Talking to a Linux desktop from Go usually means shelling out to gio, xdg-mime or notify-send, or binding GLib/GIO through cgo. go-freedesktop implements the underlying freedesktop.org specifications directly — parsing the same on-disk files and speaking the same D-Bus interface — in pure Go with cgo disabled. One small module per spec, reusing standard XDG base-directory resolution, so a launcher, file manager or shell pulls in only the layer it needs and cross-compiles to a static binary.

Modules

lib

desktopentry

Implements the Desktop Entry spec: enumerate the installed applications and expand their Exec= launch commands (field codes, TryExec, actions) — what a dock or app menu needs.

lib

icontheme

Implements the Icon Theme spec: resolve an icon name to a file path at a target size and scale, following theme inheritance and the hicolor fallback.

lib

mime

Implements the Shared MIME-info Database: resolve a canonical MIME type from a file's name, its content (magic), or both, against the on-disk database.

lib

mimeapps

Implements the MIME Applications Associations spec (mimeapps.list): the default application and the ordered candidate list for a type, with round-trippable edits — the engine behind “Open With…”.

lib

menu

Implements the Desktop Menu spec: turn applications.menu XML into a resolved, categorized tree of app entries (Accessories, Graphics, System, …) for a launcher.

lib

notifications

Implements the Desktop Notifications spec: the org.freedesktop.Notifications D-Bus service side — decode Notify calls and render them as go-widgets Toasts.

docs

docs

Versioned documentation site (MkDocs Material + mike): one page per module with the API surface and usage. Source →

brand

brand

Logos and icons for the organization, in SVG / PNG / JPG / ICO / ICNS across colour, white and black variants.

Quality bar