More actions
#!/usr/bin/python3
import win32api, win32con, argparse
screenid = 1
a = argparse.ArgumentParser()
a.add_argument('on', nargs="?", default=False, type=lambda x: x.lower() not in ("false", "0", "off"))
b = a.parse_args()
screenstring = f"\\\\.\\DISPLAY{screenid:d}"
if b.on:
win32api.ChangeDisplaySettingsEx(screenstring, None)
else:
s = win32api.EnumDisplaySettings(screenstring, win32con.ENUM_CURRENT_SETTINGS)
s.PelsWidth = 0
s.PelsHeight = 0
win32api.ChangeDisplaySettingsEx(screenstring, s)