#dbus #screen #capture #ffi #linux

portal-screencast

Rustic interface to the ScreenCast Desktop Portal

1 unstable release

0.1.0 Mar 5, 2021

#111 in #screen

MIT license

18KB
355 lines

XDG ScreenCast Portal utilities

This module defines an interface for interacting with the ScreenCast portal.

The general interaction pattern with the ScreenCast portal is to open a session, set which source types are of interest, and call start().

let screen_cast = ScreenCast::new()?.start(None)?;

In more complex cases you can modify the ScreenCast before starting it:

let mut screen_cast = ScreenCast::new()?;
// Set which source types to allow, and enable multiple items to be shared.
screen_cast.set_source_types(SourceType::MONITOR);
screen_cast.enable_multiple();
// If you have a window handle you can tie the dialog to it
let screen_cast = screen_cast.start(Some("wayland:<window_id>"))?;

Dependencies

~5.5MB
~122K SLoC