I was wondering if there are any libraries for Python, C or C++ that help you interface with your window manager/x-windows? I am currently using os.subprocess and feeding it wmctrl bash commands and though this kind of works it feels very dirty.

I've found a couple of libraries that try to do this, but they are all from 2016 (or way older) and usually version 0.something which is kinda questionable. I am not looking for something like Qtile or a different window manager as I frankly quite enjoy the Gnome window manager, I just want to extend it slightly with some personalized scripts.

I'd prefer it if the libraries are in Python, C or C++ but if you know of some which are written in different languages I'd be happy to hear about those too :D

  • Good is subjective ;-) I removed it but there is a chance people will still disagree with me... asking for lists is also not accepted.
    – Rinzwind
    Mar 29, 2021 at 12:46
  • @Rinzwind Fair, thanks for removing it. and what do you mean that asking for lists is not accepted? I'm just looking for a library doing a thing in one of three languages. How it that asking for lists of things? Mar 29, 2021 at 14:30
  • Oh you are asking for "any libraries" That is asking for someone to create a list but it looks like there is only 1 so it stops there already :D
    – Rinzwind
    Mar 29, 2021 at 14:32
  • I don't agree with your definition of any, but okay. Most certainly since I couldn't find any myself. Apr 1, 2021 at 10:11
  • Oh I did not act on it ;-) Just made an observation :+
    – Rinzwind
    Apr 1, 2021 at 10:35

1 Answer 1


Have a look at libwnck.

API docs for the Python bindings are here, you need to install the package gir1.2-wnck-1.0 to use them.

It should be usable with C++, too, but I've never tried that.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.