Skip to content

Commit 6d157d9

Browse files
author
kkohli
committed
pushing eye blink reminder script
1 parent 77fede6 commit 6d157d9

File tree

3 files changed

+45
-0
lines changed

3 files changed

+45
-0
lines changed

eye_blink_reminder/README.MD

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# 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.
2+
3+
4+
## Requirements
5+
6+
For this script to run you need to have playsound package installed
7+
8+
9+
```python
10+
pip3 install playsound
11+
```
12+
13+
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.
14+
15+
16+
To run the script, use the following command
17+
18+
``` python
19+
python3 eye_blink_reminder.py
20+
```
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import os
2+
import playsound
3+
import time
4+
from time import sleep
5+
import sys
6+
import multiprocessing
7+
8+
9+
def remind():
10+
startTime = time.time()
11+
while True:
12+
sleep(20*60)
13+
os.popen('osascript -e "set Volume 6"')
14+
p = multiprocessing.Process(target=playsound.playsound, args=("danger.mp3",))
15+
p.start()
16+
inp = input('Dismiss? y|n')
17+
18+
if inp == 'y':
19+
print("yes")
20+
p.terminate()
21+
continue
22+
23+
24+
if __name__ == "__main__":
25+
remind()

eye_blink_reminder/requirements.txt

Whitespace-only changes.

0 commit comments

Comments
 (0)