Does anyone know how to get the PID of the top active window and then how to get the properties of the window using the PID? I mean properties like process name, program nam
I run this command on a terminal:
sleep 5s; ps -Flwwp $(xdotool getwindowpid $(xdotool getwindowfocus))
Run it, change the focus to the relevant window, wait 5 seconds, then back to terminal. Voilà!