检查打开窗口列表

检查打开窗口列表

我需要知道如何找到打开的列表“视窗”,然后关闭其中的一些。请注意,任何窗口都是必需的,这意味着在使用软件进行模拟期间可能会打开某些窗口(例如绘图)。我也想检测它们。想象一下我使用一个数学软件,它在新窗口中绘制图表。

答案1

使用该wmctrl程序。

一个示例(使用 KDE 作为 DE 完成)

#list open windows
wmctrl -l
0x01e001a6 -1 HOSTNAME plasma-desktop
0x01e007c1 -1 HOSTNAME plasma-desktop
0x01e00194 -1 HOSTNAME plasma-desktop
0x01e0019d -1 HOSTNAME plasma-desktop
0x03c00064  0 HOSTNAME Inbox - Mozilla Thunderbird
0x0240001a  0 HOSTNAME pam.d : bash – Konsole
0x04e00009  0 HOSTNAME 
0x03e0006e  0 HOSTNAME shell - check the list of Open window - Unix & Linux Stack Exchange - Mozilla Firefox
0x03e6efe3  0 HOSTNAME Mozilla Firefox


#now close the empty firefox session: (-c for close, -i for using the hexnumber of the first column as identifier)
wmctrl -ic 0x03e6efe3

您还可以使用此程序更改窗口几何形状、选择窗口、移动窗口、更改窗口标题等。检查man wmctrl查看的可能性。

相关内容