How can I kill a specific X window

Given IDs produced by wmctrl -l, I d like to be able to kill the process linked to the window ID.

How would you suggest to do it?'


Besides listing the PID as described in other answers by Florian Diesch and Serg, you can use -ic option to close the window directly:

$ wmctrl -ic 0x02e00085

If you use wmctrl -lp the PIDs are in the third column.

For a given window ID you can use

kill $(wmctrl -lp | awk '/^WID/ {print $3}')

(replace WID with your window ID)