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
Install wmctrl (from the repositories). wmctrl -lp could be what you want. You can always take a look at the source if you need it from your program.
wmctrl -lp