Skip to content

Commit 3569348

Browse files
authored
Merge pull request #925 from kshitijkohli/eye_blink_reminder
[Feature-#910] : Eye blink reminder in every 20 minutes
2 parents 4e15bf8 + 57f339b commit 3569348

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-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: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import os
2+
import playsound
3+
from time import sleep
4+
import multiprocessing
5+
6+
7+
def remind():
8+
while True:
9+
sleep(20 * 60)
10+
os.popen('osascript -e "set Volume 6"')
11+
p = multiprocessing.Process(
12+
target=playsound.playsound, args=("danger.mp3",))
13+
p.start()
14+
inp = input('Dismiss? y|n')
15+
16+
if inp == 'y':
17+
print("yes")
18+
p.terminate()
19+
continue
20+
21+
22+
if __name__ == "__main__":
23+
remind()

0 commit comments

Comments
 (0)