desktop

package
v0.8.0-alpha Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package desktop talks to the desktop the server runs on (when it has one): opening the web app in the default browser and showing the system's own folder picker during setup.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrCancelled means the viewer closed the folder picker without choosing.
	ErrCancelled = errors.New("cancelled")
	// ErrUnavailable means there is no desktop to show a dialog on (service,
	// container, SSH session, no picker tool installed).
	ErrUnavailable = errors.New("no desktop folder picker available")
)

Functions

func Ask

func Ask(title, text string, buttons []string) (int, error)

Ask shows a question in the system's own dialog and returns the index of the button chosen, or -1 when it was closed or Escape was pressed. The first button is the default (Enter). ErrUnavailable means there's no desktop, or no way to show one.

Tests never call it: it opens a real window on someone's screen.

func Headless

func Headless() bool

Headless reports whether this process has no interactive desktop: running as a service, in a container, over SSH without a display, or told so with WMS_NO_BROWSER=1.

func OpenFolder

func OpenFolder(dir string) error

OpenFolder shows a folder in the system's file manager.

func OpenURL

func OpenURL(u string) error

OpenURL opens u in the default browser.

func PickFolder

func PickFolder(ctx context.Context, title string) (string, error)

PickFolder uses the desktop's own dialog through zenity (GNOME and most others) or kdialog (KDE), whichever is installed.

Types

This section is empty.

Jump to

Keyboard shortcuts

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