Skip to content

Add GUI Area Selector#89

Draft
nicolo-mn wants to merge 18 commits intowaycrate:masterfrom
nicolo-mn:gui-selector
Draft

Add GUI Area Selector#89
nicolo-mn wants to merge 18 commits intowaycrate:masterfrom
nicolo-mn:gui-selector

Conversation

@nicolo-mn
Copy link
Copy Markdown

This PR adds a GUI area selector, able to select either screens (outputs) or windows (toplevels). It's started from waysip with the flag -g, and it was added to libwaysip to be used by external applications as well. For each output and toplevel it attemps to take a screenshot to show, but it handles the cases where the capture fails (for example, if there's no toplevel capture support, which is my case).

Please see a demonstration below. There might be a bug in iced_layershell that results in the theme being applied only after a first interaction from the user (as can be seen from the video, the background is initially white). The dark theme could be removed to avoid the bug being shown, but I think it makes sense as buttons are better distinguishable from the background with a dark theme.

Right now the dimensions of the selector are hardcoded, which might result in it being very small on high resolution screens.

gui_selector.mp4

@Decodetalkers
Copy link
Copy Markdown
Collaborator

I am afraid that this gui cannot invoke twice in the same thread

@Decodetalkers
Copy link
Copy Markdown
Collaborator

Ok, it is quite cool and no problem!!, but you need to export the feature by iced, especially tokio and async-std, and also , you should let areaselectgui can accept a waylandconnection.

Greate job!

@Decodetalkers
Copy link
Copy Markdown
Collaborator

Decodetalkers commented Dec 12, 2025

And because if we use the iced, it may become too heavy, we need to make this feature selectable. and maybe you also need to add a example for it

And maybe also i18n in the feature.

So only silint has that problem.. that was too bad

@nicolo-mn nicolo-mn force-pushed the gui-selector branch 2 times, most recently from a2bbbef to a1699d3 Compare February 15, 2026 15:29
@Shinyzenith
Copy link
Copy Markdown
Member

@Decodetalkers Can we get this merged?

@Decodetalkers
Copy link
Copy Markdown
Collaborator

Decodetalkers commented Feb 18, 2026

@Decodetalkers Can we get this merged?

I am waiting for @nicolo-mn , if he think it is ok, I will start reviewing it. But I think this pr should not use git but the stable release

@nicolo-mn
Copy link
Copy Markdown
Author

Hello, with the recent commits I made the selector accept a WaylandConnection, added an example, added i18n, made the GUI feature optional, made the theme selectable by the user and modified the logic to take the screenshots asynchronously.

I also did a quick search regarding the namespaces for the surfaces, turns out they are not standardized. The thread says they're used for positioning, but from what I understand they're also used for styling, as can be noticed in this Hyprland Wiki page (SwayFX offers a similar feature using namespaces). Looking at what slurp does, they seem to set the namespace to "selection", so I replaced the old string with "selection" to do the same here as well.

@Decodetalkers
Copy link
Copy Markdown
Collaborator

Have you tried this feature in different async runtime? Last time I found that the blocking feature of zbus will panic in tokio runtime, because that blocking is just using the async-std blocking. So I am worrying about it

@nicolo-mn
Copy link
Copy Markdown
Author

I've tried running it in a tokio environment with the code below, and it works fine. Also tried the same with smol.

#[tokio::main]
async fn main() {
    let _ = AreaSelectorGUI::new().launch();
}

@Decodetalkers
Copy link
Copy Markdown
Collaborator

Decodetalkers commented Feb 20, 2026

Wait for a minute, if you just need only one layershell,you should use application not daemon

@nicolo-mn
Copy link
Copy Markdown
Author

Yes, that's right. The original idea was to display the selector on all screens, but since you suggested to keep it on the current monitor only, daemon is useless. Just removed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

4 participants