Initial structure
This commit is contained in:
parent
8520008301
commit
88366f4fe2
|
@ -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"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
|
@ -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
|
||||||
|
```
|
|
@ -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()
|
Loading…
Reference in New Issue