-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheyecare
40 lines (30 loc) · 1.03 KB
/
eyecare
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
from sys import argv, exit
from getopt import getopt
from subprocess import call
from random import choice
def main():
"""Friendly reminders to keep your eyes healthy."""
try:
opts, args = getopt.getopt(argv[1:], 'n:', ['name='])
except getopt.GetoptError as err:
print str(err)
print 'To pass your name on the command line use the "-n" or "--name" option.'
exit(2)
name = 'mate'
for o, a in opts:
if o in ('-n', '--name'):
name = a
reminders = [
'ok %s, give your eyes some rest' % name,
'come on %s, your eyes need some rest' % name,
'give your eyes a break, will you?',
'pause %s, your eyes need a break' % name,
'stop for a minute, for your eyes sake',
'sorry to interrupt, your eyes need a quick break',
'look through the window, ok?',
'listen %s, your eyes could use some rest' % name
]
call(['/usr/bin/say', choice(reminders)])
if __name__ == "__main__":
main()