screenshare

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: MIT, MIT Imports: 10 Imported by: ? 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 screenshare is the screen shares the desktop portal runs: what each ScreenCast or RemoteDesktop session streams, and a way to stop one. The portal serves Interface; Shares follows it for the bar.

Index

Constants

View Source
const (
	BusName   = "org.freedesktop.impl.portal.desktop.lys"
	Path      = dbus.ObjectPath("/org/freedesktop/portal/desktop")
	Interface = "dev.stubbe.lys.ScreenShares1"
)

D-Bus identity: the portal backend's name and object, where Interface sits beside the org.freedesktop.impl.portal ones.

View Source
const (
	KindScreenCast    = "screencast"
	KindRemoteDesktop = "remotedesktop"
)

The kinds of share.

View Source
const (
	TargetOutput  = "output"
	TargetWindow  = "window"
	TargetRegion  = "region"
	TargetDynamic = "dynamic"
)

The kinds of target.

Variables

View Source
var Changed = dbusx.NewSignal[struct{}](Interface, "Changed")

Changed is emitted when a share starts or ends.

Functions

This section is empty.

Types

type Share

type Share struct {
	Session dbus.ObjectPath
	// App is the app's id; "" for an app outside a sandbox.
	App     string
	Kind    string
	Targets []Target
}

Share is one session streaming the screen.

type Shares

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

Shares follows the portal's shares on a session bus: the list is read again on each Changed and each time the portal comes or goes.

func Follow

func Follow(conn *dbus.Conn) (*Shares, error)

Follow starts following the shares on conn.

func (*Shares) Close

func (s *Shares) Close()

Close stops following, once the watch has taken its match rules off the bus.

func (*Shares) List

func (s *Shares) List() []Share

List is the shares running now.

func (*Shares) Stop

func (s *Shares) Stop(ctx context.Context, session dbus.ObjectPath) error

Stop ends the share of session.

func (*Shares) Subscribe

func (s *Shares) Subscribe() (<-chan struct{}, func())

Subscribe ticks whenever the list changed.

type Target

type Target struct {
	Kind string
	// Name is the output's connector, or the window's identifier.
	Name string
	// Title is a window's title where the compositor tells it.
	Title string
}

Target is one source a share streams.

Jump to

Keyboard shortcuts

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