aboutsummaryrefslogtreecommitdiff
path: root/src/bin/watcher
blob: bd3301c2760c1dafe63d48ceb5d3677ba0ac4063 (plain) (blame)
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
#!/usr/bin/python3

## watcher --start == will starts the process of making csv
# watcher --daily-summary == will give you your day overview till that point
# watcher --week-summary == will gives user their week overview of screen time

import os
import sys
sys.path.insert(0, "/usr/share/Watcher/")
import argparse
import watch_log as x
from colored_text import Color
import commands as cmd

def help_option():
    print(Color.BLUE("Watcher") + " - Minimal open source screen-time tracker\n")
    print(Color.YELLOW("USAGE:")+"\n\t watcher [OPTION]\n")
    print(Color.YELLOW("OPTIONS"))
    print("\t-ds, --day-summary       Displays where you have spend your time of that day")
    print("\t-ws, --week-summary      Displays screen-time of each day of week")
    print("\nFor more information see github repo: https://github.com/Waishnav/Watcher and Don't forget to star the repo")


#print("▒▒▒\t▒▒▒\n███")
arg = sys.argv[1]
if arg == "-ds" or arg == "--day-summary":
    cmd.daily_summary()
elif arg == "-ws" or arg == "--week-summary":
    os.popen("python3 /usr/share/Watcher/week_analysis.py")
    cmd.week_summary()
elif arg == "-h" or arg == "--help":
    help_option()
elif arg == "--start":
    x.log_creation()
elif arg == "--version":
    print("Version: 1.0")
else:
    print(Color.RED("Wrong")+" [OPTION] choosen. Have a look at the Options!!\n")
    print(Color.YELLOW("OPTIONS"))
    print("\t-ds, --day-summary     Displays where you have spend your time of that day")
    print("\t-ws, --week-summary      Displays screen-time of each day of week")
    print("\nFor more information see github repo: https://github.com/Waishnav/Watcher and Don't forget to star the repo")

#parser = argparse.ArgumentParser(description="Minimal open source screen-time calulator for digitally wellbeing")
#parser.add_argument()
#args = parser.parse_args()
#print(args)