ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
I apologize up front that this isn't strictly a programming question, but it is the sort of thing that programmers deal with so I'll ask it here (plus programmers are really smart and know a lot ).
So, when I run xlsclients, I see only those windows that were started by clients running on the local host. Any X client applications that get started on remote hosts do not have their windows listed. I believe it has to do with the SSH X tunnel that is created by logging into the remote host. Somewhere along the way, the SSH client must make a connection to the X server, as a sort of proxy for the remote application, and I suppose it is the nature of the SSH tunnel that conceals the windows, although the mechanism escapes me.
The reason I care about this is that I want to be able to take xwd snapshots of a running application, and I want to be able to do this on a periodic basis in a cron job. Any work-arounds that accomplish the goal are also welcome.
Thanks.
--- rod.
Thanks for your reply. I have already tried the -a flag, and it doesn't help. I know about -display, but what to supply as the argument? The windows that are listed by xlsclients are on the display of interest. I am speculating that the display ID, if that is the correct terminology, is somehow being mangled or concealed by the SSH tunnel. I feel confident that my problem is solvable, since programs like the GIMP, Ksnapshot, and ImageMagick 'display' are capable of performing screen grabs. The problem with them is that they require an interactive session to select the window with a mouse. I need a screen grabber that I can specify by window ID, and therefore I need to be able to get the window ID. Thats what xlsclients almost does.
Yes, I understand what you are saying. However, in this case, it isn't the server that is remote; it is the client(s). The server is on the localhost, server # ':0'. And it does report windows created by clients running on localhost, but not windows created by clients on remote hosts.
Thanks for your replies.
--- rod.
Okay, I've solved my problem. I was using the wrong tool for the job. I found that xwininfo reports the ID of the window of interest, and that is all I need to provide as an argument to xwd. I can run xwininfo -root -tree, and get a list of all the windows on the display. From there, I can find the window of interest by searching for the window title included in the list, thus giving me the ID.
--- rod.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.