7

In a dual monitor system is it possible to mirror a single window and not the entire screen? Put it another way, can I ask an X application to open simultaneously on DISPLAY :0.0 and :0.1?

Basically this can be useful for presentations, where one needs to send to the projector just a copy of the PDF (or the like) window.

My window manager is Openbox.

0

1 Answer 1

3

For this specific requirement with X11 and Openbox, I don't know if it is possible to do such a hackery, but with VNC is quite easy to achieve what you are after.

Mirroring a single X application with x11vnc

  1. Get id of window that you want to mirror: xwininfo
  2. x11vnc -id {replace-by-window-id}

Probably you will have to install x11vnc but you can use whatever VNC client is installed already on your pc (Remmina on Ubuntu), just mind the port number given by x11vnc.

Mirroring the whole screen with default apps

Most of the popular linux distros already have a vnc server and client installed. On Ubuntu the VNC server is vino and Remmina the client, installing them is straight forward, something like sudo apt-get install vino remmina or the equivalent sudo yum install vino remmina.

To check if Vino is installed, launch vino-preferences and if you get preferences window you already have it, enable the sharing and at the security section require a confirmation dialog on connection or password.

Once this is done you can start the Vino server by /usr/lib/vino/vino-server (at least for Ubuntu this is working). Enter this command in your startup apps if you wish vino to start automatically.

Then you just need to connect with Remmina: select VNC as connection type and for the address input box enter 0.0.0.0:5900 and press Connect! A dialog should pop up asking if you allow the remote connection if you have set it so in the vino-preferences. After you allow it you'll get one of the dual screens mirrored on the other one. Problem solved.

  • If you are in a secure network and so speed&quality can be your utmost priority, you could enable connections to your vino server without encryption: gsettings set org.gnome.Vino require-encryption false
5
  • Thank you, indeed I would like to share a single window.
    – antonio
    Commented Jan 21, 2018 at 11:17
  • updated the answer to include an only single window solution.
    – obeliksz
    Commented Jan 22, 2018 at 7:29
  • @antonio You can also try GStreamer without running a server.
    – Yai0Phah
    Commented Oct 23, 2020 at 16:56
  • There's also this suggestion, which sounds promising but I haven't got it working: askubuntu.com/questions/777478/mirror-single-window
    – CPBL
    Commented Oct 12, 2021 at 19:15
  • The single window solution does not work for me. The VNC appears to start up (based on output in the terminal) but no copy of my desired window appears. Is there another step?
    – CPBL
    Commented Oct 12, 2021 at 19:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .