简体   繁体   English

列出所有gnome终端窗口

[英]Listing of all gnome-terminal windows

My ubuntu setup, has various shell-scripts that help me get my work done. 我的ubuntu设置包含各种shell脚本,可以帮助我完成工作。 Of which, many of the important ones, are persistent. 其中许多重要的问题是持久的。 I have a single shell, that does the "loading" of these various persistent shells. 我只有一个外壳,可以“装载”这些各种持久性外壳。

However i would like it to be able to monitor all the various sub-shell. 但是我希望它能够监视所有各种子外壳。 And to be able to recreate it, after it itself has closed / any sub-shell closes. 为了能够重新创建它,它本身已经关闭/任何子外壳都关闭了。

Making the whole thing fully automated. 使整个过程完全自动化。

Currently, each shell would have its own unique title : hence even a simple list of all opened gnome terminal titles would work... >.< problem is, getting that done. 当前,每个shell都有其自己的唯一标题:因此,即使是所有打开的gnome终端标题的简单列表也可以使用...>。<问题是做到了。

Use: 采用:

$ wmctrl -l

to list all the windows managed by the window manager, or 列出由窗口管理器管理的所有窗口,或者

$ wmctrl -l -x | grep gnome-terminal\\.Gnome-terminal

to list all the gnome-terminals. 列出所有的gnome终端。

Check man wmctrl for more info. 检查man wmctrl以获取更多信息。

To list the window titles of all gnome-terminal windows: 列出所有gnome-terminal窗口的窗口标题:

$ xdotool search --onlyvisible -class gnome-terminal getwindowname %@

The window title of each gnome-terminal window is the title of the current tab 每个gnome-terminal窗口的窗口标题是当前选项卡的标题

The option --onlyvisible is not hiding minimized windows, or windows on other desktops. --onlyvisible选项不会隐藏最小化的窗口或其他桌面上的窗口。 It suppresses "internal" windows, which are not really part of the GUI. 它禁止显示“内部”窗口,这些窗口实际上不是GUI的一部分。


You can list the PIDs for the windows - note multiple or all terminal windows may belong to the same process of gnome-terminal : 您可以列出窗口的PID-请注意,多个或所有终端窗口可能属于gnome-terminal的同一进程:

$ xdotool search --onlyvisible -class gnome-terminal getwindowpid %@

To list the X window IDs, use the default action after search: 要列出X窗口ID,请在搜索后使用默认操作:

$ xdotool search --onlyvisible -class gnome-terminal

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM