diff power_osx.py @ 2:0ecb388a0b90

start power code
author drewp@bigasterisk.com
date Sat, 04 Mar 2023 12:10:36 -0800
parents
children 3d7fc94a404a
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/power_osx.py	Sat Mar 04 12:10:36 2023 -0800
@@ -0,0 +1,21 @@
+import subprocess
+import Quartz
+
+def is_screen_on():
+    d=Quartz.CGSessionCopyCurrentDictionary()
+    print(d)
+
+
+
+def go_lock_screen():
+    pass
+
+
+def go_wake_screen():
+    pass
+
+
+def go_sleep_mode():
+    subprocess.run(['pmset', 'sleepnow'])
+
+is_screen_on()
\ No newline at end of file