#!/usr/bin/python import os import sys sys.path.insert(0, "/usr/share/Watcher/") import watch_log as x from commands import Color import commands as cmd from analysis import weeklly_logs 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("\t-s, --start It starts taking logs afterwards in following directory ~/.cache/Watcher/raw_data/") print("\nFor more information see github repo: https://github.com/Waishnav/Watcher and Don't forget to star the repo") #print("▒▒▒\t▒▒▒\n███") try: arg = sys.argv[1] if arg == "-ds" or arg == "--day-summary": cmd.daily_summary() elif arg == "-ws" or arg == "--week-summary": weeklly_logs() cmd.week_summary() elif arg == "-h" or arg == "--help": help_option() elif arg == "--start" or arg == "-s": print("Log creations started... \nif you wanna stop it, use keyboard-shortcut (Ctrl+Shift+C or Ctrl+C)") x.log_creation() elif arg == "--version": print("Version: 1.2") 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") except IndexError: help_option() #parser = argparse.ArgumentParser(description="Minimal open source screen-time calulator for digitally wellbeing") #parser.add_argument() #args = parser.parse_args() #print(args)