Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2d9677a

Browse files
Merge pull request avinashkranjan#2205 from Swapnil-Singh-99/stay_hydrated
added a python script to stay hydrated
2 parents eecfb10 + 0c7bfbb commit 2d9677a

File tree

3 files changed

+28
-0
lines changed

3 files changed

+28
-0
lines changed

‎Stay Hydrated/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Stay Hydrated
2+
It is a python script that runs in background while you work on your Laptop/PC and notifies you to drink water at regular time intervals
3+
4+
# Installation & Run
5+
`pip install -r requirements.txt`
6+
7+
`python main.py`
8+
9+
# Screenshots
10+
![Screenshot-from-2023年07月12日-14-23-58.png](https://i.postimg.cc/BQcgccKd/Screenshot-from-2023年07月12日-14-23-58.png)

‎Stay Hydrated/main.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
import time
2+
from plyer import notification
3+
4+
def drink_water_reminder():
5+
"""Sends a notification to the user to drink water."""
6+
title = "Drink Water Reminder"
7+
message = "It's time to drink some water!"
8+
notification.notify(title, message)
9+
10+
def main():
11+
"""Runs the drink water reminder function every hour."""
12+
while True:
13+
time.sleep(1200)
14+
drink_water_reminder()
15+
16+
if __name__ == "__main__":
17+
main()

‎Stay Hydrated/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
plyer==2.1.0

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /