Bug 506237 - Make it possible to select screen(s) to share in xdg-desktop-portal from command line
Summary: Make it possible to select screen(s) to share in xdg-desktop-portal from comm...
Status: RESOLVED NOT A BUG
Alias: None
Product: xdg-desktop-portal-kde
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.4.0
Platform: Fedora RPMs Linux
: NOR wishlist
Target Milestone: ---
Assignee: Plasma Bugs List
URL: https://discuss.kde.org/t/is-there-a-...
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-26 20:11 UTC by Piotr Dobrogost
Modified: 2025-07-21 13:10 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Dobrogost 2025-06-26 20:11:10 UTC
Make it possible to select screen(s) to share in xdg-desktop-portal from command line and save selection so that there would be no need for physical presence at the remote host to establish connection.

See https://discuss.kde.org/t/is-there-a-way-to-select-screen-s-to-share-in-xdg-desktop-portal-from-command-line/36195?u=piotr_dobrogost
Comment 1 TraceyC 2025-06-30 20:52:03 UTC
.
Comment 2 David Redondo 2025-07-01 12:09:19 UTC
Tricky: 

- we would need to  craft restoredata beforehand as xdg-desktop-portal also needs a matching restore token that the app can use
- that needs app cooperation anyway since it needs to know the token

- we could have an override that skips the dialog for a specific app and selects something chosen beforehand

- interfacing on the command line is tricky since the backend doesnt know where you are typing atm
- there could be a mode where instead of dialogs it wants input on stdin, complicated by the fact that we could by started by dbus activation

- maybe a tool that can list/accept/deny requests???
Comment 3 David Edmundson 2025-07-21 13:00:51 UTC
>and save selection so that there would be no need for physical presence at the remote host to establish connection.

This end goal here makes sense, and is something we are working towards. 
The suggestion here on how to approach it is not the right method and as such I'm closing this.

We want command line options on krdp to say what screen to use and then forward that information to the portal which will then do the thing the client asked. There's no need to have a way to override the portal. 

In the meantime what you're probably looking for is "krdpserver --plasma --virtual-monitor". 

After https://invent.kde.org/plasma/xdg-desktop-portal-kde/-/merge_requests/420 you won't need the "--plasma" part.
Comment 4 David Edmundson 2025-07-21 13:10:12 UTC
Edit, I see you were using rustdesk. But the principle applies.

We also have a semi-hidden method to pre-approve authentication prompts. See 2d4a4dfec07e478ab57fb70a1f531ba496382467 in xdg-dekstop-portal-kde.