xdg-share-screen

Automates XDG Desktop Portal Share Screen permission granting via restore tokens or simulated keystrokes on Wayland Linux desktops.

Updated Aug 27, 2026
One-click install
npx skills add https://github.com/yanivprusman/automateLinux --skill xdg-share-screen
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xdg-share-screen
Source: https://github.com/yanivprusman/automateLinux/tree/main/.agent/skills/xdg-share-screen
Command: npx skills add https://github.com/yanivprusman/automateLinux --skill xdg-share-screen

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Automates the interaction with the XDG Desktop Portal's Share Screen dialog, enabling smoother screen sharing workflows on Wayland environments.

Core Features & Use Cases

  • Native portal handling with restore tokens to grant permission without repeated prompts.
  • Fallback UI automation via window discovery and simulated input when token-based access is unavailable.
  • Use cases include automated screen recording setup, scripted onboarding of new machines, and repeatable test environments requiring screen sharing.

Quick Start

Automate the XDG Share Screen dialog by first attempting a native portal session with a persistable restore token, and if necessary, fallback to focusing the portal window and sending a sequence of keystrokes to select and share.

Frequently Asked Questions about xdg-share-screen

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I automate the XDG Desktop Portal Share Screen dialog on Wayland?

Automating the XDG Share Screen dialog on Wayland involves using a native portal session via org.freedesktop.portal.ScreenCast with restore_token handling for persistent permissions, falling back to UI automation with simulated keystrokes if token-based access fails.

Can I script screen sharing permissions to avoid repeated Wayland portal prompts?

Scripting screen sharing permissions to avoid repeated Wayland portal prompts is possible by implementing native restore_token flows through the xdg-desktop-portal, which persists the token to grant access automatically during subsequent sessions.

What is the best way to set up automated screen recording on Wayland desktops?

The best way to set up automated screen recording on Wayland desktops is to request a ScreenCast portal session using DBus and manage the restore_token, ensuring the xdg-desktop-portal grants permission without manual dialog interaction.

Does the xdg-share-screen automation work when restore tokens are unavailable?

When restore tokens are unavailable, xdg-share-screen automation falls back to UI automation by locating the Share Screen window, focusing it, and issuing simulated keystrokes to select and share the screen.

Why does my scripted Wayland screen sharing setup fail to bypass the portal dialog?

Scripted Wayland screen sharing setups fail to bypass the portal dialog when native restore_token persistence is not implemented correctly or the fallback UI automation cannot locate the xdg-desktop-portal Share Screen window to simulate input.

Do I need DBus to automate screen sharing through the XDG Desktop Portal?

Yes, DBus is required to automate screen sharing through the XDG Desktop Portal, as it facilitates the native org.freedesktop.portal.ScreenCast session communication and restore_token handling needed to grant permissions programmatically.