Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to programmatically be able to communicate with the Window Manager in Gnome 3, using D-Bus. The tasks I would like to accomplish are:

  • listening for new windows
  • get window flags (e.g. skip pager flag)
  • get X window IDs
  • maximise, minimise windows
  • raise, lower windows
  • hide windows The aim is to create an task-bar-like application.

I know of tools such as xdotools or wmctrl, but those are very thorough tools: there are no listeners to find out if new windows have been instantiated / mapped, the latte works with window title strings.

I also tried using python-xlib, but lack of documentation or too technical documentation have made it very difficult to achieve anything.

It seems D-Bus would be appropriate for such actions. Can I use D-Bus to do this, is there a way to do this using Python? Could you provide examples?

share|improve this question
up vote 0 down vote accepted

You would need a D-Bus-to-X11 interface in order to do this. There is no such thing.

share|improve this answer
Ok, so how do you listen to newly mapped windows, as with a new pop-up for instance? And what API would you use? Is a xdotool good enough to build a shell or do you need to use python-xlib perse? – Benjamin Dec 23 '11 at 8:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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