Retrieve X11 window ID of a just-launched GUI-program
4
votes
2
answers
2285
views
I want to retrieve the X id of GUI programs I launch in background, in order to work on their windows properties. I've been so far using this workaround:
myprogram &
sleep 1
winID=$(wmctrl -l | awk '/./{line=$0} END{print $1;}')
But this relies on three heavy assumptions:
- the program will take less than 1 second to get its window opened (not to mention than 1 second can be far too long)
- the window will be appened at the end of the
wmctrl
list
- no other window will be opened meanwhile
Is there any signal myprogram
will send once it has opened a window? How can I intercept it?
Asked by iago-lito
(2931 rep)
Dec 17, 2014, 06:03 PM
Last activity: Sep 3, 2022, 11:41 AM
Last activity: Sep 3, 2022, 11:41 AM