Ask Your Question
3

Is there a way to use a linux command to identify the window IDs connected to a particular process ID?

asked 2021-07-02 11:00:00 +0000

david gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-08-26 08:00:00 +0000

huitzilopochtli gravatar image

Yes, you can use the xwininfo command to find the window ID associated with a particular process ID.

  1. First, find the process ID of the application with the ps command:
ps -ef | grep <process_name>
  1. Once you have the process ID, run the xwininfo command:
xwininfo -root -tree | grep "<pid>"

Replace with the process ID you obtained in step 1.

The xwininfo command will display information about all visible windows on the screen. The grep filter will narrow the output to display only the window IDs associated with the specified process ID.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2021-07-02 11:00:00 +0000

Seen: 10 times

Last updated: Aug 26 '22