portal

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2026 License: MIT Imports: 62 Imported by: 1 module, 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 lys-shell's xdg-desktop-portal backend: the org.freedesktop.impl.portal.* interfaces the compositor-independent xdg-desktop-portal frontend routes sandboxed apps' requests to, served as one object under the org.freedesktop.impl.portal.desktop.lys name that `lys-shell portal` claims. Interactive interfaces delegate their dialogs to the running shell over its own D-Bus services.

Index

Constants

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

Response codes of an interactive method's (u, a{sv}) reply.

View Source
const AppearanceNS = "org.freedesktop.appearance"

AppearanceNS is the cross-desktop namespace every toolkit reads.

View Source
const BackgroundIface = "org.freedesktop.impl.portal.Background"

BackgroundIface is org.freedesktop.impl.portal.Background.

View Source
const BusName = "org.freedesktop.impl.portal.desktop.lys"

BusName is the backend's well-known name (lys-shell.portal's DBusName).

View Source
const ClipboardIface = "org.freedesktop.impl.portal.Clipboard"

ClipboardIface bridges the Wayland selection to clipboard-enabled RemoteDesktop sessions: they read the current selection, become its owner, and serve its data on demand.

View Source
const GlobalShortcutsIface = "org.freedesktop.impl.portal.GlobalShortcuts"

GlobalShortcutsIface bridges org.freedesktop.impl.portal.GlobalShortcuts to the compositor's hyprland-global-shortcuts-v1, as xdg-desktop-portal-hyprland does: shortcuts the user allows are registered there, and their presses come back as Activated / Deactivated. The compositor owns the triggers: the user binds each shortcut in its config (Hyprland's `global` dispatcher). Without the protocol nothing can be bound.

View Source
const GnomeInterfaceNS = "org.gnome.desktop.interface"

GnomeInterfaceNS is the namespace GTK's portal settings backend reads its toolkit settings from.

View Source
const InhibitIface = "org.freedesktop.impl.portal.Inhibit"

InhibitIface is org.freedesktop.impl.portal.Inhibit.

View Source
const LockdownIface = "org.freedesktop.impl.portal.Lockdown"

LockdownIface is the policy the frontend consults before allowing printing, saving, devices and so on.

View Source
const NotificationIface = "org.freedesktop.impl.portal.Notification"

NotificationIface turns portal notifications into org.freedesktop.Notifications calls the shell's daemon shows, and forwards the daemon's ActionInvoked back as the portal's. A press reaches the app as the action it named, with its target, then the platform-data holding the activation-token the daemon announced for the press (its ActivationToken), so the app can raise its window.

View Source
const ObjectPath = dbus.ObjectPath("/org/freedesktop/portal/desktop")

ObjectPath is where every interface is mounted.

View Source
const RemoteDesktopIface = "org.freedesktop.impl.portal.RemoteDesktop"

RemoteDesktopIface lets a session drive the pointer and keyboard: after the user consents, the Notify* methods and an EIS connection are replayed onto a virtual pointer and keyboard. Touch is not supported.

View Source
const RequestIface = "org.freedesktop.impl.portal.Request"

RequestIface is the object the frontend passes the handle of into every interactive method, so the app can abort it.

View Source
const ScreenCastIface = "org.freedesktop.impl.portal.ScreenCast"

ScreenCastIface is org.freedesktop.impl.portal.ScreenCast: SelectSources records the options, Start shows the shell's share picker (unless a restore token already names the source), starts a PipeWire producer per picked source and replies their node ids. The selection never leaves lys-shell, so it works on any compositor.

View Source
const SessionIface = "org.freedesktop.impl.portal.Session"

SessionIface is the object ScreenCast, RemoteDesktop, GlobalShortcuts and Inhibit monitors put at a session handle in CreateSession; it lives until the app or the backend closes it.

View Source
const SettingsIface = "org.freedesktop.impl.portal.Settings"

SettingsIface serves org.freedesktop.appearance from the live styling config, so GTK, Qt and Chromium follow lys-shell's theme, and the org.gnome.desktop.interface keys a sandboxed GTK app reads its theme, icons, cursor and font from instead of the host's settings.ini.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	// contains filtered or unexported fields
}

Backend is the running portal backend.

func New

func New(conn *dbus.Conn, cfg *config.Service) *Backend

New builds the backend over a session-bus connection and the config.

func (*Backend) Serve

func (b *Backend) Serve() (stop func(), err error)

Serve mounts the interfaces, claims BusName (failing loudly when another backend owns it rather than queueing and idling forever) and starts the settings watcher and the notification action forwarder. The returned stop ends both, runs every live session's cleanup and drops the name.

type Vardict

type Vardict = map[string]dbus.Variant

Vardict is a portal a{sv}: every interactive method's options and results.

Jump to

Keyboard shortcuts

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