finding monitor or screen resolution in Linux with standard python module

A

akbar

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.
 
?

=?ISO-8859-1?Q?Jos=E9_Antonio_Salazar_Montenegro?=

I'm using Beryl too, and xwininfo -root gives te correct resolution.
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.

NOTA: La informacion de este correo es de propiedad exclusiva y confidencial. Este mensaje es solo para el destinatario indicado, si usted no lo es, destruyalo de inmediato. Ninguna informacion aqui contenida debe ser entendida como dada o avalada por MADISA, sus subsidiarias o sus empleados, salvo cuando ello expresamente se indique. Es responsabilidad de quien recibe este correo de asegurarse que este libre de virus, por lo tanto ni MADISA, sus subsidiarias ni sus empleados aceptan responsabilidad alguna.

NOTE: The information in this email is proprietary and confidential. This message is for the designated recipient only, if you are not the intended recipient, you should destroy it immediately. Any information in this message shall not be understood as given or endorsed by MADISA, its subsidiaries or their employees, unless expressly so stated. It is the responsibility of the recipient to ensure that this email is virus free, therefore neither MADISA, its subsidiaries nor their employees accept any responsibility.
 
M

MonkeeSage

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.

Perhaps read-edid [1] or ddcprobe [2] would work since they read the
info strait off the EDID. You could probably read the EDID from python
(mabye through the xlib binding?), but no need to reinvent the wheel.

[1] http://john.fremlin.de/programs/linux/read-edid/index.html
[2] http://sources.gentoo.org/viewcvs.py/gentoo-src/Xorgautoconfig/ddcprobe/

Regards,
Jordan
 
C

consmash

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,009
Latest member
GidgetGamb

Latest Threads

Top