-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathScreen time.py
More file actions
30 lines (23 loc) · 762 Bytes
/
Screen time.py
File metadata and controls
30 lines (23 loc) · 762 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import os
import rumps
import subprocess
class Screen_time(rumps.App):
def __init__(self):
super(Screen_time, self).__init__("Screen Time")
self.menu = ["Usage","Quit","Clean Quit"]
self._quit_button =None
@rumps.clicked("Usage")
def prefs(self,_):
subprocess.run("open /System/Library/PreferencePanes/Screentime.prefPane",shell=True)
@rumps.clicked('Quit')
def clean_up_before_quit(self,_):
To_close_System_prefrences = """osascript -e '
tell application "System Preferences"
quit
end tell
'"""
os.system(To_close_System_prefrences)
@rumps.clicked('Clean Quit')
def quit_Screen_time(self,_):
rumps.quit_application()
Screen_time().run()