Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
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
20 changes: 20 additions & 0 deletions eye_blink_reminder/README.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This is a Python Script which shoots you a reminder every 20 mins to take a break from screen and blink your eyes for 20 seconds looking at an object 20 feet away : 20-20-20 rule for Dry Eyes.


## Requirements

For this script to run you need to have playsound package installed


```python
pip3 install playsound
```

Copy any media file which you want to run as the reminder sound and replace it in the playsound args. Currently it is set as "danger.mp3" which is a local file in my working directory.


To run the script, use the following command

``` python
python3 eye_blink_reminder.py
```
23 changes: 23 additions & 0 deletions eye_blink_reminder/eye_blink_reminder.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import os
import playsound
from time import sleep
import multiprocessing


def remind():
while True:
sleep(20 * 60)
os.popen('osascript -e "set Volume 6"')
p = multiprocessing.Process(
target=playsound.playsound, args=("danger.mp3",))
p.start()
inp = input('Dismiss? y|n')

if inp == 'y':
print("yes")
p.terminate()
continue


if __name__ == "__main__":
remind()