Repository navigation
Conversation
sachahjkl
added a commit
to sachahjkl/ShojiWM
that referenced
this pull request
Nov 12, 2026
sachahjkl
force-pushed
the
feat/portal-external-picker
branch
from
November 16, 2026 22:10
a3ff38f to
97ce7d4
Compare
When SHOJIWM_PORTAL_PICKER is set, the ScreenCast portal runs that command instead of the built-in iced picker: it writes the sources as one JSON object on the command's stdin and reads the chosen source id from its stdout. A non-zero exit, empty output or unknown id cancels; a closed session kills the command. A desktop built on ShojiWM can then show a chooser in its own look.
…oo, as the screencast one does
sachahjkl
force-pushed
the
feat/portal-external-picker
branch
from
November 21, 2026 16:29
97ce7d4 to
e5b53d7
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The ScreenCast portal shows its own picker window (iced). A desktop built on ShojiWM may want the choice to look like the rest of its UI, so this lets it provide the picker as a command.
When
SHOJIWM_PORTAL_PICKERis set (read once at startup), eachSelectSourcesruns that command throughsh -cinstead of opening the iced window:{"app_id": "org.example.App", "prefer": "window", "sources": [ {"id": "DP-1", "kind": "output", "name": "DP-1", "description": "...", "x": 0, "y": 0, "width": 2560, "height": 1440, "refresh_mhz": 144000}, {"id": "<ext_foreign_toplevel identifier>", "kind": "window", "title": "...", "app_id": "..."} ]}preferiswindowwhen only windows are asked for.idon its first stdout line and exits 0.kill_on_drop).Without the variable nothing changes. The requesting app id is now passed to
PickerHandle::pick; the iced path does not use it. The variable and the protocol are documented in the installation page (English only; I did not touch the Japanese translation).Tests: four unit tests in
external_picker.rsrun realshcommands: a choice read from the request, a failed exit, an unknown id, and a cancelled session that must stop a running picker (bounded by a timeout). I use it with a desktop's own dialog (shojiwm-desktop) that speaks this protocol; I have tested that dialog against the same JSON, but not yet through a full ScreenCast session from a browser.