jordansissel / xdotool

fake keyboard/mouse input, window management, and more
Other
3.28k stars 321 forks source link

need equivalent of wmctrl -lpx #22

Open aspiers opened 11 years ago

aspiers commented 11 years ago

wmctrl can list all visible windows across all desktops in one go, along with their window name, class, window id, pid, and desktop number:

$ wmctrl -lpx
0x01800003 -1 5733   xfdesktop.Xfdesktop   pacific Desktop
0x04200003 -1 6104   gkrellm.Gkrellm       pacific gkrellm
0x0520000b -1 6186   urxvt.URxvt           pacific watchlogs-system
0x01600004 -1 5732   xfce4-panel.Xfce4-panel  pacific xfce4-panel
0x05e00032  5 23702  skype.Skype           pacific Skype
0x01200047  0 26835  emacs.Emacs           pacific focus-emacs-frame
0x0500000b  1 4759   urxvt-256color.URxvt  pacific adam@pacific

This is very convenient for scripting.

jordansissel commented 9 years ago

There's probably room for a new xdotool command to do formatted (and/or json!) outputs some properties of any windows in the window stack. Thoughts?

Rough proposal:

xdotool selectwindow windowproperties id pid class

Would use selectwindow to have oyu click on a window, then this proposed 'windowproperties' command would output the id, pid, and window class for the window. This would also work with xdotool search ... windowproperties ... or something.

Thoughts?

aspiers commented 9 years ago

Yes, sounds good!