Initial structure

This commit is contained in:
Abhorrent_Anger 2019-10-21 00:14:56 +03:00 committed by Mārtiņš Kurmis
parent 8520008301
commit 88366f4fe2
6 changed files with 52 additions and 1 deletions

15
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,15 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "Python: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}

BIN
Files/default.mp3 Normal file

Binary file not shown.

BIN
Files/eye_dark.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

BIN
Files/eye_light.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -1,3 +1,9 @@
# EyeStrainReminder # EyeStrainReminder
A small background tool to remind the user of the "20-20-20" rule. A small background tool to remind the user of the "20-20-20" rule.
```
sudo apt-get install python-gobject libnotify-bin python-gst-1.0
pip3 install notify2
```

30
main.py Normal file
View File

@ -0,0 +1,30 @@
#!/usr/bin/python3
import notify2
from time import sleep
#from playsound import playsound
NAME = 'Eye Strain Reminder'
MESSAGE = 'Friendly reminder to observe the 20-20-20 rule'
TIMEOUT = 20
MILLISECOND = 1000
def init():
notify2.init(NAME)
def uninit():
notify2.uninit()
def send_notification():
#playsound('files/default.mp3')
notification = notify2.Notification(NAME, MESSAGE)
notification.set_timeout(TIMEOUT * MILLISECOND)
notification.set_urgency(notify2.URGENCY_LOW)
notification.show()
sleep(TIMEOUT)
notification.close()
#playsound('files/default.mp3')
if __name__ == '__main__':
init()
send_notification()
uninit()