altdesktop / i3ipc-python

🐍 An improved Python library to control i3wm and sway.
http://i3ipc-python.readthedocs.io
BSD 3-Clause "New" or "Revised" License
851 stars 109 forks source link

get Pid in i3 #156

Closed windwp closed 4 years ago

windwp commented 4 years ago

Is there anyway to get pid in i3 not sway?

acrisci commented 4 years ago

Not with the ipc. But you can try to read _NET_WM_PID property of the window with an X11 library. Check out the xprop command.

windwp commented 4 years ago

Yeah i know that xprop command but It will make my script slow

acrisci commented 4 years ago

Check out the python-xlib library.