finding monitor or screen resolution in Linux with standard python module

consmash at gmail.com consmash at gmail.com
Wed Mar 7 15:38:58 EST 2007


On Mar 7, 11:25 am, "akbar" <akbarh... at gmail.com> wrote:
> I googled and searched in archive. All I can find is finding
> resolution with Tkinter and pygame. Any idea to find monitor
> resolution with standard python module?
> I can check from output of: xprop -root
> _NET_DESKTOP_GEOMETRY(CARDINAL) . The problem is when you use Beryl or
> Xgl, it is not correct anymore because Beryl or Xgl set this value
> from amount of workspaces multiplied by monitor or screen resolution.

A method 'screen' from Python X Library looks promising:
http://python-xlib.sourceforge.net/doc/html/python-xlib_16.html#SEC15

More, or less if I understand right you just need to request from
server dimensions of the screen, over x protocol of course. So it will
be something associated with Xlib.




More information about the Python-list mailing list