Skip to content
Open
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
40 changes: 40 additions & 0 deletions water_break_reminder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import time
import datetime
import platform
import os

# Time between reminders (in seconds) — 30 minutes = 1800 seconds
REMINDER_INTERVAL = 1800

MESSAGES = [
"💧 Time to drink some water!",
"👀 Look away from the screen for 20 seconds to relax your eyes.",
"🧍‍♀️ Stand up and stretch your legs!",
"☕ Take a short break — you’ve earned it!"
]

def notify(message: str):
"""Display a system notification or terminal message."""
print(f"[{datetime.datetime.now().strftime('%H:%M:%S')}] {message}")

# Use native notifications if available
if platform.system() == "Darwin": # macOS
os.system(f"osascript -e 'display notification \"{message}\" with title \"Break Reminder\"'")
elif platform.system() == "Linux":
os.system(f"notify-send 'Break Reminder' '{message}'")
elif platform.system() == "Windows":
# Windows toast notification via powershell
os.system(f'powershell -Command "New-BurntToastNotification -Text \'{message}\'"')

def main():
print("🔔 Break Reminder is running... (Press Ctrl+C to stop)")
while True:
for msg in MESSAGES:
notify(msg)
time.sleep(REMINDER_INTERVAL)

if __name__ == "__main__":
try:
main()
except KeyboardInterrupt:
print("\n🛑 Break Reminder stopped. Take care of yourself!")