-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpomodore.py
66 lines (47 loc) · 1.8 KB
/
pomodore.py
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
from datetime import datetime
from time import sleep, strftime
import ctypes
from ctypes import CDLL
from pushsafer import Client
longrest = 1
cycle = 1
os = 'mac' #acceptable os: mac, win
current_time=strftime("%H:%M")
push_safer_private_key='' #https://www.pushsafer.com/en/python
def lock_screen(os):
if os == 'mac':
login = CDLL('/System/Library/PrivateFrameworks/login.framework/Versions/Current/login')
result = login.SACLockScreenImmediate()
elif os == 'win':
ctypes.windll.user32.LockWorkStation()
def notify_iphone():
client = Client(push_safer_private_key)
request = client.send_message("Your rest shift has ended!","⭐️ Head back to work!","a","1","","2","www.pushsafer.com","Open Pushsafer","0","2","60","600","1","","","")
print(f'\n{"="*80}\n\nYour 2 shifts\' pomodore system has started...')
while longrest != 3:
print(f'\n{"*"*80}')
while cycle<=4:
print(f'{current_time} Focus cycle {cycle}/4 started...')
sleep(1/2)
print('Time to work!!!')
sleep(2)
sleep(60*25) #25 minutes of focus
if cycle != 4:
print(f'\n{current_time} Focus cycle {cycle}/4 ended...')
sleep(1/2)
print('Walk around!!! Go out and see the day!!!')
sleep(2)
lock_screen(os)
sleep(60*5) #5 minutes of rest
notify_iphone()
cycle+=1
print(f'{"*"*80}')
print(f'\n{"*"*80}\n{current_time} 5\' rest shift {longrest}/2 ended...')
sleep(1/2)
print(f'15\' rest shift has started...\nDon\'t just check your social media !!!!\n{"*"*80}\n')
sleep(2)
lock_screen(os)
sleep(60*15) #15 minutes of rest
notify_iphone()
longrest+=1
print(f'\n{current_time} Your 2 shifts\' pomodore system has ended...\n{"="*80}\n')