-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (30 loc) · 1.06 KB
/
main.py
File metadata and controls
38 lines (30 loc) · 1.06 KB
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
import time
import subprocess
import sys
from install_scripts import check_requirements
def main():
print("--- Focus Assist Nudge ---")
check_requirements()
# 1. Get User Input
goal = input("What is your focus goal right now? > ").strip()
if not goal:
print("You must have a goal!")
return
mode = input("Choose mode (online/offline) [default: offline] > ").strip().lower()
if mode not in ["online", "offline"]:
mode = "offline"
print(f"\nOkay! I'll check on you every 5 minutes.")
print(f"Goal: {goal}")
print(f"Mode: {mode}")
print("Press Ctrl+C to stop.\n")
try:
while True:
print("zzzz... (waiting 5 mins)")
time.sleep(300)
print("Waking up! Scanning screen...")
# Run the scanner in a separate process
subprocess.run([sys.executable, "scanner.py", "--goal", goal, "--mode", mode])
except KeyboardInterrupt:
print("\nStopping Focus Assist. Good luck!")
if __name__ == "__main__":
main()