How can i “spy” on my second dual monitor output from the main monitor screen?
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
How can i “spy” on my second dual monitor output from the main monitor screen?
I have a dual monitor laptop setup, but have no way to view the second monitor screen, unless i leave and go into a different area of the building, so how can i view the contents of the second monitor output on my main primary screen? Preferably a software method, without buying extra hardware like a kvm/splitter/extra monitor/etc.
Ideally, i would like a live desktop background of my second monitor always playing as the default desktop image, so if i want to see the second screen, i could just minimize my windows and see it live. But, I could see using a widget, or an application like VNC, VLC, but i presume this would put alot of overhead on my already busy CPU, so i'd rather not. Is there a more direct tap method, i.e. some way i can just route the actual raw monitor feed to a tandem/slave output into something? This way no capture/compression/streaming/etc is going on, it's just a direct monitor tap, kind of like screen mirroring tap, but without needing 3 monitors (one main, and two mirrored).
Is there a quick soft-switch method, like hitting a few keys to momentarily swap screens, or something like ctl alt F# to switch terminal sessions, or some other workspace switcher way to link monitors to the built in linux workspaces?
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524
Rep:
Hi 1branchonthevine,
Welcome to LQ!
You can use gnome-control-center to set up your displays, but it would a bit of a pain to do it often. I'm interested in why you would connect a second monitor that you can't view.
If you just want a peek that doesn't cost any CPU otherwise, then you could use a screenshot utility. The exact details would depend on your favorite image viewer utility and the desktop environment/WM you use.
But basically, my strategy would be:
1) Set up a panel launcher icon for a custom script (~/peeker.sh)
2) Install some sort of screenshot utility if necessary, such as xfce4-screenshooter, and an image viewer, like geeqie, if necessary
3) write the script peeker.sh to take a screenshot and display it in a window. Something like:
That way, when I click on that panel launcher icon, it will run the script; it takes a full screenshot and saves it to /tmp for output to the image viewer.
When the script isn't running, this consumes no CPU at all.
Unless you've gone out of your way to change it, the default behavior should be for your task bar to list all open windows, regardless of which monitor they are displaying on. So you should easily be able to figure out what is RUNNING on the hidden display, but this wouldn't tell you what it is currently DISPLAYING.
You might try changing desktop settings temporarily. If you turn off dual displays then I would assume that all open windows would transfer to your main display (I haven't tested that, but that's what I assume would happen). When you're done inspecting those previously hidden windows, turn dual displays back on. But (still assuming here) I'd think that all your windows would still be clustered on your main screen, I doubt they'd know to automatically move back to that second monitor that you just re-enabled.
What would be ideal, is if you could define a workspace/screen binding. i.e., "Workspace #1 displays on Screen #1" and "Workspace #2 displays on Screen #2". Then maybe you could use the built-in workspace switcher to move between the two by changing which screen is bound to which workspace. I searched for something like this about a year ago, but did not find it. Things may have changed since then however.
I would like something like this too. With my dual monitor setup, I don't often use the second screen (it is in vertical orientation, and I mostly use that for software writing). So I leave that second monitor turned off. Every now and then when I open a new window from my main screen, for some unknown reason it decides to open over on the second screen. Yeah, the one that is turned off. I have learned to look down at my task bar and if the window I just tried to open is listed there, but I don't see it on my main screen, I know to turn on the second screen and manually drag to errant window back to where I want it to display. Most everything does the sensible thing and opens on my main screen, but there are a few idiot programs that are kind of dumb. The best example of that for my system is "Kindle for PC" (the eBook reader) running under Wine. It just loves that second (turned off) screen for some reason. Also, after a reboot, I'll sometimes click on the Start Menu icon and the popup opens on the second screen. Now THAT is really annoying. Luckily, I seldom reboot, so it's not a terribly big deal. Dual monitor setup is not perfect under Linux. But it's not great under Windows either. There's always some psycho window that thinks the grass is greener over on the "other" monitor.
You might be able to use x11vnc to do it, give it the -display argument of the second display (probably something like :0.1) and then run a vnc viewer program and connect with that vnc server. This should let you see it and interact with it if you want.
You might be able to use x11vnc to do it, give it the -display argument of the second display (probably something like :0.1) and then run a vnc viewer program and connect with that vnc server. This should let you see it and interact with it if you want.
This is actually just a single display spanning multiple monitors. So this would...well it would not work right. However, something similar may work. I'm going to try it right now...
Okay, this will work using x11vnc server and xtightvnc client. On a Debian based distribution, install these with:
Code:
apt-get install x11vnc xtightvncviewer
x11vnc is the server which lets you view/control an existing x11 display. (Contrast with vnc servers which create their own independent X sessions.)
xtightvncviewer is one of several possible vnc clients. They all have subtle differences, so the precise one you use matters. I think xtightvncviewer may be the only one which displays the server's mouse pointer.
You want to clip the x11vnc server to just the secondary screen. The first two numbers are the size of the secondary screen. The next two numbers are the coordinates of the upper left corner, relative to the overall virtual screen space.
It is very important that you use "-viewonly" mode in vncviewer. Otherwise...well, it won't work right. It'll try to send mouse/keyboard events and ... bleh.
Once you get this working, you can create a shell script/icon to activate this. Make it something like this:
Don't forget to "chmod 755 myscript.sh" to make it executable. Then, set up a launcher icon for it with your GUI desktop environment. This will let you click on the launcher at any time to "remotely" view your second screen; close it by closing the viewer window.
haertig... Binding workspaces to monitors would be perfect! I could just click a workspace on my main screen, and instead of it being a new blank space for the main screen, it could be assigned/binded to the second monitor, that way I can see everything going on in that workspace/monitor. Perfect! But, still no luck finding this on google forum searches... let me know if you happen to stumble on it later!
Although I did find this post, but it seems to use a different window manager "i3?" I'm not so sure this is even quite what i'm looking to do:
----------------------------------------------------
SIMILAR QUESTION:
Assign workspaces on i3 to multiple displays
I've switched on using i3 on my Linux laptop. I'm usually using only the laptop's internal monitor (display eDP1), but when I'm at work I tend to connect a secondary monitor to my computer's HDMI port (display HDMI2). So far, I've made this work fine by adding these commands to my i3 config file:
In other words, when I connect my HDMI display I just press Mod+M to get i3 to detect it, place it right of my primary display, and delegate 5 named workspaces (6-10) to it.
Here's the problem: At home, I have another monitor that I can connect with VGA (display DP2). I can run the xrandr command above to place this display to the right of my primary display as well, but I can't get the workspaces to be assigned to this display by default, unless I replace the rules I already have for my HDMI monitor. I would like both these workspaces to work the same no matter which monitor I use, so this is not an option.
TL;DR Is there a way to assign workspaces to two different displays, depending on which display is connected (assuming they never will be connected at the same time)?
----------------------------------------------------
REPLY:
You can't assign multiple outputs to single workspace, see: https://github.com/i3/i3/issues/555
So the only way is to change i3 config dynamically. You could assign to hotkey script that will be doing 2 things: changing monitor outputs with xrandr and moving workspaces with i3-msg:
With above script you will move 6-10 workspaces to DP2 and end up staying on workspace 10.
----------------------------------------------------
Quote:
Originally Posted by haertig
Unless you've gone out of your way to change it, the default behavior should be for your task bar to list all open windows, regardless of which monitor they are displaying on. So you should easily be able to figure out what is RUNNING on the hidden display, but this wouldn't tell you what it is currently DISPLAYING.
You might try changing desktop settings temporarily. If you turn off dual displays then I would assume that all open windows would transfer to your main display (I haven't tested that, but that's what I assume would happen). When you're done inspecting those previously hidden windows, turn dual displays back on. But (still assuming here) I'd think that all your windows would still be clustered on your main screen, I doubt they'd know to automatically move back to that second monitor that you just re-enabled.
What would be ideal, is if you could define a workspace/screen binding. i.e., "Workspace #1 displays on Screen #1" and "Workspace #2 displays on Screen #2". Then maybe you could use the built-in workspace switcher to move between the two by changing which screen is bound to which workspace. I searched for something like this about a year ago, but did not find it. Things may have changed since then however.
I would like something like this too. With my dual monitor setup, I don't often use the second screen (it is in vertical orientation, and I mostly use that for software writing). So I leave that second monitor turned off. Every now and then when I open a new window from my main screen, for some unknown reason it decides to open over on the second screen. Yeah, the one that is turned off. I have learned to look down at my task bar and if the window I just tried to open is listed there, but I don't see it on my main screen, I know to turn on the second screen and manually drag to errant window back to where I want it to display. Most everything does the sensible thing and opens on my main screen, but there are a few idiot programs that are kind of dumb. The best example of that for my system is "Kindle for PC" (the eBook reader) running under Wine. It just loves that second (turned off) screen for some reason. Also, after a reboot, I'll sometimes click on the Start Menu icon and the popup opens on the second screen. Now THAT is really annoying. Luckily, I seldom reboot, so it's not a terribly big deal. Dual monitor setup is not perfect under Linux. But it's not great under Windows either. There's always some psycho window that thinks the grass is greener over on the "other" monitor.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.