After stackoverflow answered my previous question on here about my Wiimote left/right click issue, Not only can I move the mouse cursor, I can now left/right click on things. I now have one more question.
What do I use in python to get the title of the current active window? After googling 'X11 Python Window Title', 'Linux Python Window Title' and things similar, All I've found is win32 and tkinker (again?), which isn't what I need.
If you could help, That would be awesome!
Is the problem to find out which window is active or what the title is? Getting a window's title is easy:
,where MainWindow is the window's name. No idea about active window though. Never had multiple windows.
I think python-wnck might be useful if you want to handle Windows & workspaces & such. I can't find the Python docs immediately, but according to the docs for the libwnck C library that it wraps, it has a wnck_screen_get_active_window() method.
killown's xprop-based solution can be compacted into a single (though lengthy) statement:
My solution:
EDIT
best way:
Alternative way:
I noticed that wnck requires GTK event loop to update the active window. There is no such problem with Xlib: