go-desktopenv

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 29, 2026 License: MIT

README

go-desktopenv

Go


What a packaged Go desktop app needs to reach its desktop: xdg-desktop-portal calls, Flatpak detection and host commands, per-user folders, console-less Windows children and Desktop Entry Exec values. Module github.com/Rethunk-Tech/go-desktopenv, five packages: portal, flatpak, userdirs, desktopentry and nowindow. Import only the ones you need; flatpak, userdirs, desktopentry and nowindow pull in no third-party code.

A Flatpak app needs --talk-name=org.freedesktop.Flatpak for flatpak; portals need nothing extra. A portal call waits on a user dialog until its context ends, so set a deadline. RetrieveSecret works only inside a Flatpak.

Quick start

go get github.com/Rethunk-Tech/go-desktopenv

A worked example and the contracts: HUMANS.md.

Features

  • portal: autostart, launchers, the per-app secret and desktop settings, each bounded by your context
  • flatpak: detect a sandbox, run or build a command for the host, end the host child on cancel
  • userdirs: config and data folders per home, honouring only absolute environment values for the real home
  • desktopentry: escape, build and read Desktop Entry Exec= values
  • nowindow: no console window for a console child of a Windows GUI process

Documentation

Doc Audience
HUMANS.md Running and using the package
AGENTS.md Internals, invariants, and why
CONTRIBUTING.md Process — commits, tests, docs
SECURITY.md Vulnerability disclosure
CHANGELOG.md Release notes

License

MIT — see LICENSE. © 2026 Rethunk.Tech, LLC.

Directories

Path Synopsis
Package desktopentry escapes and reads the string values of a freedesktop Desktop Entry file, chiefly the Exec key.
Package desktopentry escapes and reads the string values of a freedesktop Desktop Entry file, chiefly the Exec key.
Package flatpak detects a Flatpak sandbox and runs commands on the host from inside one.
Package flatpak detects a Flatpak sandbox and runs commands on the host from inside one.
Package nowindow starts console programs from a GUI process without a console window.
Package nowindow starts console programs from a GUI process without a console window.
Package portal calls the xdg-desktop-portal interfaces a Flatpak app uses instead of writing host folders: the Background portal for starting at sign-in, DynamicLauncher for desktop launchers, Secret for a per-app master secret, and Settings for desktop appearance values.
Package portal calls the xdg-desktop-portal interfaces a Flatpak app uses instead of writing host folders: the Background portal for starting at sign-in, DynamicLauncher for desktop launchers, Secret for a per-app master secret, and Settings for desktop appearance values.
Package userdirs answers where a user's config and data folders are for a given home.
Package userdirs answers where a user's config and data folders are for a given home.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL