Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use wl-mirror? #22

Closed
sebas891 opened this issue Apr 21, 2023 · 5 comments
Closed

How to use wl-mirror? #22

sebas891 opened this issue Apr 21, 2023 · 5 comments
Labels
duplicate This issue or pull request already exists

Comments

@sebas891
Copy link

I'm trying to figure how to use wl-mirror. I'm on Debian testing using gnome and wayland, I don't understand the parameter I should put in the when running the command wl-mirror. What would be examples of output?

My use case is that I have projector as a second screen connected to my laptop and I would to monitor the output of the projector in a window on my main laptop screen. Can I accomplish that with wl-mirror?
Any help will be appreciated.

Cheers,

$ xrandr --query | grep '\bconnected\b'
XWAYLAND80 connected primary 1920x1080+0+1080 (normal left inverted right x axis y axis) 310mm x 170mm
XWAYLAND82 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 520mm x 290mm

@Ferdi265
Copy link
Owner

Hi! wl-mirror currently only supports Wayland compositors based on wlroots, such as sway or hyprland (haven't tested it on hyprland yet, but it should work).

Support for the two other big compositors (KDE and Gnome) is planned, but not implemented yet. This would require supporting the XDG Desktop Portals screenshare API (#16) and negotiating server or client-side window decorations (#17) and of course a bunch of testing.

On sway, you would start wl-mirror with a command like wl-mirror eDP-1 or wl-mirror HDMI-A-1, which will open a resizable window containing a view of the specified output that you can move wherever you want. Note that the names you can pass to wl-mirror are not be the names you get listed from xrandr. On sway you can get a list of the available outputs with swaymsg -t get_outputs

So yes, your use case would be easily solved by wl-mirror if you were either on sway or if Gnome support were finished already.

I'm marking this issue as a duplicate of #17 since you are using Gnome, which is not supported yet.

@Ferdi265 Ferdi265 added the duplicate This issue or pull request already exists label Apr 21, 2023
@sebas891
Copy link
Author

Many thanks for the clear and complet answer! For now, I give a try to Sway. I'll be there to test the gnome support when it comes around.
Thanks for all the work on wl-mirror!

@Thaodan
Copy link

Thaodan commented Apr 22, 2023

On sway, you would start wl-mirror with a command like wl-mirror eDP-1 or wl-mirror HDMI-A-1, which will open a resizable window containing a view of the specified output that you can move wherever you want. Note that the names you can pass to wl-mirror are not be the names you get listed from xrandr. On sway you can get a list of the available outputs with swaymsg -t get_outputs

How would you make sway "ignore" those screens? I have setup where I have DP-1, DP-3 and HDMI-A-1. I mirror DP-3 on HDMI-A-1. I don't want Sway to spawn work spaces on the screen that is mirrored.

Hyprland can kinda do that but is rather unstable.

@Ferdi265
Copy link
Owner

You can't really ignore them but you can prevent your mouse from going there by setting their coordinates so that there is a gap between them.

e.g. if you use the two DP screens and want to mirror to the HDMI one:

DP-1 at 0,0 with 1920x1080, DP-3 at 1920,0 with 1920x1080 (contiguous, no gap), HDMI-A-1 at 3900,0 with 1920x1080 (gap of 60 pixels)

it also helps if you make the active workspace on HDMI-A-1 something that you are unlikely to use, e.g. workspace 11.

With a gap like this, sway will prevent you from moving your mouse to the gapped off monitor normally, but you can still switch to it using the keyboard and by focusing the workspace that lives on that monitor.

@Thaodan
Copy link

Thaodan commented Apr 23, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants