HowTo:Get window pid by mouse click (Gnome)
#!/bin/sh WINID=`xwininfo | sed -n 's/.*Window\ id:\ \(0x[0-9A-Fa-f]*\).*/\1/p'` echo "Found winid: ${WINID}" WINPID=`xprop -id ${WINID} _NET_WM_PID | sed -n 's/.*_NET_WM_PID.*=\s\([0-9]*\).*/\1/p'` echo "Found window pid: ${WINPID}" ps -aux | grep $WINPID