Sample Header Ad - 728x90

Detecting when an X Window has been closed

2 votes
1 answer
462 views
I'm running Ubuntu 20.04.5 LTS with the XFCE4 window manager. I'm looking for a way for a shell script to be fired off when a particular X Window has been closed. I know that I can create a program to run wmctrl or xdotool over and over again in a loop that checks for the existence of the X Window in question, and then executes a shell script when the presence of that X Window is no longer detected. But I'm wondering whether there might be some sort of event-based utility that I can run which can do some or all of this for me, instead of my having to write this busy-wait-based program. Any suggestions? Thank you in advance.
Asked by HippoMan (737 rep)
Sep 7, 2022, 10:07 PM
Last activity: Sep 8, 2022, 09:59 AM