portal

package
v0.3.21 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: MIT Imports: 8 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package portal is the xdg-desktop-portal client side lys-shell needs: the Request/Response handshake and the FileChooser.

Index

Constants

View Source
const (
	BusName      = "org.freedesktop.portal.Desktop"
	ObjectPath   = dbus.ObjectPath("/org/freedesktop/portal/desktop")
	RequestIface = "org.freedesktop.portal.Request"
)

Portal bus identity.

View Source
const (
	ResponseSuccess   uint32 = 0
	ResponseCancelled uint32 = 1
	ResponseOther     uint32 = 2
)

Response codes of org.freedesktop.portal.Request.Response.

View Source
const FileChooserIface = "org.freedesktop.portal.FileChooser"

FileChooserIface is org.freedesktop.portal.FileChooser.

Variables

View Source
var ErrCancelled = errors.New("portal: request cancelled")

ErrCancelled is a request the user dismissed.

Functions

func OpenFile

func OpenFile(ctx context.Context, conn *dbus.Conn, title string, filters ...FileFilter) (string, error)

OpenFile asks the user for one file (GTK's FileDialog.open through the portal) and returns its local path. A dismissed chooser is ErrCancelled.

Types

type FileFilter

type FileFilter struct {
	Name     string
	Patterns []string
}

FileFilter is one named filter of glob patterns.

Jump to

Keyboard shortcuts

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