Mercurial > code > home > repos > racc
annotate power_osx.py @ 2:0ecb388a0b90
start power code
author | drewp@bigasterisk.com |
---|---|
date | Sat, 04 Mar 2023 12:10:36 -0800 |
parents | |
children | 3d7fc94a404a |
rev | line source |
---|---|
2 | 1 import subprocess |
2 import Quartz | |
3 | |
4 def is_screen_on(): | |
5 d=Quartz.CGSessionCopyCurrentDictionary() | |
6 print(d) | |
7 | |
8 | |
9 | |
10 def go_lock_screen(): | |
11 pass | |
12 | |
13 | |
14 def go_wake_screen(): | |
15 pass | |
16 | |
17 | |
18 def go_sleep_mode(): | |
19 subprocess.run(['pmset', 'sleepnow']) | |
20 | |
21 is_screen_on() |