0

On Windows, there are a few apps that can switch the graphics onscreen left to right (and vice versa), but to my knowledge, they all require at least 2 monitors. It seems like, because of the way Windows functions or by some mechanisms, the mirror transformation just can't work on a single screen.

I wonder whether it's theoretically possible on Linux. Are there programs that do it already?

Marcus Müller
  • 21,602
  • 2
  • 39
  • 54
longtry
  • 43
  • 6
  • 1
    Soliciting paid work is generally frowned upon. This is a free help community. Ask technical questions; looking for freelancers is not what this platform is for. (Removed that part.) – Marcus Müller Apr 11 '23 at 14:16

1 Answers1

4

Your argument about it being impossible on a single screen doesn't match my understanding and my experience. So, I'd forget about any requirement of having multiple screens. This is basic functionality.

That's a feature of basically any modern graphics adapter. If you're using X (not wayland),

xrandr --listactivemonitors

will give you a list of active monitors, like this:

Monitors: 1
 0: +HDMI-0 2560/597x1440/336+2560+0  HDMI-0

Note that HDMI-0 is the name of your screen.

Knowing the name of your screen you can then use

xrandr --output HDMI-0 --reflect x

to mirror horizontally (replace x with y to mirror vertically; use normal instead to reset to normal orientation).

It's possible the same functionality is also exposed in your screen settings (which I don't know, that depends on which session / window manager you're using).

For wayland: Haven't tried that, but I think replacing xrandr with wlr-randr (you might have to install that – how to do that depends on your distro, but it's pretty easy, usually) should do the trick.

Marcus Müller
  • 21,602
  • 2
  • 39
  • 54
  • I'm considering switching from Win to Linux, and the ability to mirror is a rather big component. Some questions: 1/ By typing those commands into the terminal, will *all* applications on Linux be mirrored? 2/ If true, then will our mouse movement stay the same, or be mirrored too? I'd like it not to change. 3/ Could you test it with your machine and advise me of unforeseen issues with the operation of mirrored screen? – longtry Apr 12 '23 at 02:43
  • It will literally mirror the s whole creen. I don't have to test this a second time, it just works. Don't know what you mean with the mouse movement - as said, the whole screen will me mirrored. You can, separately, over the movement of your mouse, but that's a different topic. – Marcus Müller Apr 12 '23 at 05:34
  • I think the mouse movement is very important within this topic. See, in normal environments, if we move our physical mouse from left to right, the pointer onscreen will also go left to right. In your mirror test, when you do that, did the pointer move right to left? That will make operating on the computer quite difficult. That's why I wrote I prefer the mouse movement to stay the same. – longtry Apr 13 '23 at 02:42
  • It's a separate issue as said, and also possible. You didn't mention it at all in your original question, which is why my answer didn't mention it. I recommend you ask a new question about the mouse inversion when the screen is mirrored. You can simply refer to this answer for "if the screen is mirrored like described in..." And say what you want the mouse to do **in a new question post**. Please don't ask new questions in the comments to answers! – Marcus Müller Apr 13 '23 at 04:35
  • I see. Thanks, will do that! One bit I need clarification: to make things back to normal, is this command correct: xrandr --output HDMI-0 --normal x ? – longtry Apr 14 '23 at 02:47
  • 1
    Exactly (assuming HDMI-0 is your screen's name) – Marcus Müller Apr 14 '23 at 05:16
  • 2
    @longtry That command should be `xrandr --output HDMI-0 --reflect normal`. There is no such option as `--normal` - as per `man xrandr`, the `--reflect` option requires an argument of either `normal`, `x`, `y` or `xy` – rowboat Apr 14 '23 at 06:52
  • sorry, yes, I misread longtry's typo. – Marcus Müller Apr 14 '23 at 07:36
  • @MarcusMüller I just installed Fedora 38, which uses wayland. I installed wlr-randr, but when following your answer's process, was stuck right at the start. `wlr-randr --listactivemonitors` was replied with `compositor doesn't support wlr-output-management-unstable-v1`. What is it, and how should I solve the problem? – longtry Jun 11 '23 at 16:46
  • please ask that as a new question post. I'm not an expert on Wayland. – Marcus Müller Jun 11 '23 at 17:10