Fixed file lookup

This commit is contained in:
Abhorrent_Anger 2019-10-23 10:52:39 +03:00
parent ca7446be0e
commit c838987002
3 changed files with 21 additions and 9 deletions

View File

@ -1,6 +1,6 @@
# EyeStrainReminder
A small background tool to remind the user of the "20-20-20" rule. Uses system notifications and sound cues.
A small background tool to remind the user of the "20-20-20" rule. Uses system notifications and sound cues. Made primarily for GNU/Linux, but might work with other environments.
First, you might need these packages:
```
@ -9,9 +9,14 @@ sudo apt-get install python-gobject libnotify-bin python-gst-1.0
Second, just install the tool and required [Python modules](src/branch/master/setup.py) via:
```
python setup.py install --user
cd EyeStrainReminder
pip install . --user
```
Run it simply with, or preferably put it to run on boot as:
```
$ eyestrainreminder
```
Or to remove:
```
pip uninstall eyestrainreminder
pip uninstall EyeStrainReminder
```

View File

@ -2,12 +2,14 @@
import notify2
from time import sleep
from playsound import playsound
import os
NAME = 'Eye Strain Reminder'
MESSAGE = 'Friendly reminder to observe the 20-20-20 rule'
TIMEOUT = 20
MILLISECOND = 1000
MINUTE = 60
DIR = os.path.dirname(os.path.abspath(__file__))
def init():
print("Initializing EyeStrainReminder...")
@ -17,7 +19,8 @@ def uninit():
notify2.uninit()
def wait():
sleep(TIMEOUT*MINUTE)
#sleep(TIMEOUT*MINUTE)
pass
def send_notification():
print(MESSAGE)
@ -25,10 +28,11 @@ def send_notification():
notification.set_timeout(TIMEOUT * MILLISECOND)
notification.set_urgency(notify2.URGENCY_LOW)
notification.show()
playsound('files/default.wav')
playsound(f"{DIR}/files/default.wav")
sleep(TIMEOUT)
notification.close()
playsound('files/default.wav')
playsound(f"{DIR}/files/default.wav")
def main():
init()

View File

@ -1,17 +1,20 @@
#!/usr/bin/env python
from setuptools import setup
import setuptools
#from distutils.core import setup
setup(name='EyeStrainReminder',
setuptools.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'],
package_data={'': ['files/*']},
include_package_data=True,
install_requires=[
'notify2',
'playsound'
'playsound',
'pystray'
],
entry_points = {
'console_scripts': [