How do xterm tell xterm to make it stand on top of all windows and in focus?

Google, I read mana about tput, stty, but I can not find it.

Or is this the means of the xterm itself not to do? Then through gnome-manager any?

1 answer 1

you can, for example, use the wmctrl program from the package of the same name:

$ wmctrl -a имя-окна 

The window name can be found by running the xwininfo program, and clicking on the window of interest. example:

 $ xwininfo xwininfo: Please select the window about which you would like information by clicking the mouse in that window. xwininfo: Window id: 0xff87aa "Terminal" ... 

the name of the window in this case is Terminal .

however, in this case all the windows that have this name will be “pulled up”. but you can address a specific window by its identifier (in the example, 0xff87aa ):

 $ wmctrl -i -a 0xff87aa 

similarly, the effect can be achieved using the xdotool program (from the package of the same name):

 $ xdotool windowactivate 0xff87aa 
  • This is of course great. And without clicks with your hands, you can somehow (lsof or something like that, but at least gdb) find out the id of the window, knowing the pid? - avp
  • @avp, as far as I know, no. From my point of view, your question can be identified with a certain degree of conventionality with the question: can the pid process know what changes have been made to the file system earlier by this process? - aleksandr barakin
  • Interesting comparison. Obviously, I will not do this, but theoretically, we also have a file descriptor leading to the X-server and, in principle, using gdb, you can fork the attached process and run its program in the descendant, inheriting this descriptor ... ( 20 years in X did not write anything). - avp
  • @avp, well, yes, of course, there is a descriptor. It is through him that x-clients communicate (via xlib calls) with the x-server. at a later time, it is usually file-based (communication via tcp is considered insecure due to the problematic nature of client authentication by means of x-server and can be found only in some thin client implementations). - aleksandr barakin