I'm using the wmctrl -lp
to try and find the process id associated with a tkinter
GUI window. However, it looks like the tkinter window is not associated with a pid.
0x06400010 0 0 N/A tk
Using xprop
, it looks like the _NET_WM_PID
property is not set.
However, I can't find any way to get tkinter
to set this automatically, or to set it explicitly from my python code.
The context is that I have a script that looks for any windows "owned" by a particular process, or any child processes thereof. But a tkinter window cannot be found by this script, because the script does not see it as being associated with the pid of the python script that creates the window.
Any help much appreciated.
EDIT: Further weirdness
It seems that this issue only arises if I run the python script from within a bash script.
So if I have a bash script gui_from_bash_script.sh
which says:
#!/bin/bash
python my_gui.py
... and then I run ./gui_from_bash_script.sh
, then I get the problem.
If I just run python my_gui.py
from the terminal, I don't get the issue.