Initial structure
This commit is contained in:
		
							parent
							
								
									85912a4630
								
							
						
					
					
						commit
						fd9437694c
					
				
							
								
								
									
										15
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										15
									
								
								.vscode/launch.json
									
									
									
									
										vendored
									
									
										Normal 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
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Files/default.mp3
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Files/eye_dark.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											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
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Files/eye_light.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| After Width: | Height: | Size: 1.8 KiB | 
| @ -1,3 +1,9 @@ | ||||
| # 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
									
								
							
							
						
						
									
										30
									
								
								main.py
									
									
									
									
									
										Normal 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() | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user