Skip to content

go-freedesktop documentation

Pure-Go (CGO_ENABLED=0) implementations of the freedesktop.org desktop-integration specifications. No cgo, no D-Bus C library, no external tools.

go-freedesktop is a family of small, independent Go modules that implement the 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. Each spec is one small module, so a caller pulls in only what it needs.

Modules

Module freedesktop specification What it gives you
desktopentry Desktop Entry Enumerate installed applications and expand their Exec= launch commands.
icontheme Icon Theme Resolve an icon name to a file path at a target size and scale.
mime Shared MIME-info Database Resolve a canonical MIME type from a file's name, content, or both.
mimeapps MIME Applications Associations Default application + ordered candidates for a MIME type.
menu Desktop Menu Turn applications.menu XML into a categorized tree of app entries.
notifications Desktop Notifications The org.freedesktop.Notifications D-Bus service side.

Design

  • Pure Go, CGO_ENABLED=0 — one portable module per spec; cross-compiles to a static binary.
  • Reuse, don't reinvent — standard XDG base-directory resolution is shared, not re-implemented; later waves build on earlier ones (mimeapps and menu stand on desktopentry).
  • 100% test coverage is the bar, error branches included, on native amd64/arm64 plus emulated 64-bit targets.
  • BSD-3-Clause throughout.