rr- / screeninfo

Fetch location and size of physical screens.
Other
205 stars 36 forks source link

Get refresh rate #79

Open nsde opened 1 year ago

nsde commented 1 year ago

Hello, could you please implement an attribute called .refresh_rate? I only managed to get the primary monitor's refresh rate using:

# pip install pywin32
import win32api

device = win32api.EnumDisplayDevices()
settings = win32api.EnumDisplaySettings(device.DeviceName, -1)
hz = settings.DisplayFrequency

print(hz)

I don't know how/if this works on other OSes and with multi-monitor setups.

Sha-yol commented 1 year ago

+1, could be a really useful addition

ShaiAvr commented 1 year ago

+1, couldn't find a cross-platform way to get the monitor's refresh rate.