Search code examples
pythonubuntumonitorresolution

Getting Monitor resolution in Python on Ubuntu


Is there a equatable bit of code to GetSystemMetrics in win32api, for Ubuntu? I need to get the monitors width and height in pixels.


Solution

  • I assume you're a GUI toolkit. Why else would you be interested in the screen dimensions?

    Check out gtk.gdk.screen_width() and gtk.gdk.screen_height() from PyGTK. Something similar should be available for QT.