File | Date | Author | Commit |
---|---|---|---|
_test | 2015-08-29 |
![]() |
[a0aed6] new setup.py |
.hgignore | 2015-08-29 |
![]() |
[a0aed6] new setup.py |
LICENSE | 2015-08-29 |
![]() |
[a0aed6] new setup.py |
Makefile | 2015-09-03 |
![]() |
[9a1202] clean target |
README.rst | 2015-01-15 |
![]() |
[7c4e81] dependeny on ruamel.base, no __init__.py |
__init__.py | 2015-08-29 |
![]() |
[a0aed6] new setup.py |
ewmh.py | 2015-08-29 |
![]() |
[a0aed6] new setup.py |
setup.py | 2015-08-29 |
![]() |
[a0aed6] new setup.py |
tox.ini | 2015-08-29 |
![]() |
[a0aed6] new setup.py |
==== EWMH ====
EWMH (Extended Window Manager Hints) can be used to retrieve and set information about windows on Linux systems. Is does this by calling and parsing the output from programs like wmctrl.
from subprocess import Popen from ruamel.ewmh import ExtendedWindowManagerHints as EWMH Popen(['xclock', '-name', 'test_xclock']) # there can be more than one window matching the title # therfore .by_title() returns a list clk = EWMH().by_title('test_xclock')[0] clk.resize_and_move(200, 200, 300, 600)
Before writing this library I tried Antonio Cuni's wmctrl package. That library looks to be abandoned (at least from April 2013 until Oct 2014).
I started ewmh because I encountered performance problems and irregular exceptions that I could not, initially fix. When I noticed that these problems were a result of design decisions, were associated with features I did not need (e.g. retrieving WM_CLASS), and because I needed something more minimal, but working, I started from scratch.
After trying to patching some of these issues, and testing, exceptions would happen which forced me to abandon it, as it was less time consuming to start from scratch. With the knowledge gained writing emwh I found that the wmctrl package currently at least doesn't handle window classes with spaces in them, nor does a program survive calling the library when there happens to be a window without a title somewhere on your desktop.
Most of the original tests included with the wmctrl library, work with only minor adjustments (which seem to have to do with my top-of-the-window menu) and a wrapper class in emwh. Moving from wmctrl to ewmh should therefore be easy.