Conversation
|
I am afraid that this gui cannot invoke twice in the same thread |
|
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! |
|
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 |
a2bbbef to
a1699d3
Compare
|
@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 |
|
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. |
967f1dc to
e107956
Compare
|
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 |
|
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();
} |
|
Wait for a minute, if you just need only one layershell,you should use application not daemon |
|
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, |
bc00c4e to
3c494e9
Compare
This PR adds a GUI area selector, able to select either screens (outputs) or windows (toplevels). It's started from
waysipwith the flag-g, and it was added tolibwaysipto 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_layershellthat 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