Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion water-reminder/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import time
from plyer import notification # can be installed by pip install plyer
import argparse

def create_arg_parser():
parser = argparse.ArgumentParser(description='Simple Application to remind you to drink water after specific period of time.')
parser.add_argument("-t", "--timelimit", type=str, required=False, help="Enter Timeinterval after which you want notification")
return parser

parser = create_arg_parser()
args = parser.parse_args()

time_interval = 6
if args.timelimit:
time_interval = args.timelimit

if __name__ == "__main__":
while True:
Expand All @@ -9,7 +22,7 @@
app_icon = "icon.png",
timeout = 10 # Will stay for 10 seconds.
)
time.sleep(6) # Will remind after one hour.
time.sleep(time_interval) # Will remind after one hour.

# In case you want to close the program and the notification should keep coming run the program using pythonw ./main.py ( after going to the folder ).

Expand Down