Setup
This commit is contained in:
parent
bba5143434
commit
8585ea3e1f
10
README.md
10
README.md
|
@ -2,8 +2,18 @@
|
|||
|
||||
A small background tool to remind the user of the "20-20-20" rule. Uses system notifications and sound cues.
|
||||
|
||||
First, you might need these packages:
|
||||
```
|
||||
sudo apt-get install python-gobject libnotify-bin python-gst-1.0
|
||||
|
||||
pip3 install notify2 playsound --user
|
||||
```
|
||||
|
||||
Second, just install the required [Python modules](src/branch/master/setup.py) via:
|
||||
```
|
||||
python setup.py install --user
|
||||
```
|
||||
Or to remove:
|
||||
```
|
||||
pip remove eyestrainreminder
|
||||
```
|
|
@ -0,0 +1 @@
|
|||
from .main import *
|
|
@ -10,6 +10,7 @@ MILLISECOND = 1000
|
|||
MINUTE = 60
|
||||
|
||||
def init():
|
||||
print("Initializing EyeStrainReminder...")
|
||||
notify2.init(NAME)
|
||||
|
||||
def uninit():
|
||||
|
@ -19,6 +20,7 @@ def wait():
|
|||
sleep(TIMEOUT*MINUTE)
|
||||
|
||||
def send_notification():
|
||||
print(MESSAGE)
|
||||
notification = notify2.Notification(NAME, MESSAGE, "notification-device-eject")
|
||||
notification.set_timeout(TIMEOUT * MILLISECOND)
|
||||
notification.set_urgency(notify2.URGENCY_LOW)
|
||||
|
@ -28,9 +30,12 @@ def send_notification():
|
|||
notification.close()
|
||||
playsound('files/default.wav')
|
||||
|
||||
if __name__ == '__main__':
|
||||
def main():
|
||||
init()
|
||||
while 1:
|
||||
wait()
|
||||
send_notification()
|
||||
uninit()
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
|
@ -0,0 +1,2 @@
|
|||
notify2>=0.3.1
|
||||
playsound>=1.2.2
|
|
@ -0,0 +1,17 @@
|
|||
#!/usr/bin/env python
|
||||
from setuptools import setup
|
||||
#from distutils.core import setup
|
||||
|
||||
setup(name='EyeStrainReminder',
|
||||
version='1.0',
|
||||
description='A small background tool to remind the user of the “20-20-20” rule.',
|
||||
author='Abhorrent Anger',
|
||||
author_email='abhorrentanger@cock.li',
|
||||
url='https://git.pube.tk/abhorrent_anger/EyeStrainReminder',
|
||||
packages=['eyestrainreminder'],
|
||||
entry_points = {
|
||||
'console_scripts': [
|
||||
'eyestrainreminder = eyestrainreminder.main:main'
|
||||
]
|
||||
},
|
||||
)
|
Loading…
Reference in New Issue