Added notification config
This commit is contained in:
		
							parent
							
								
									c819a9b692
								
							
						
					
					
						commit
						f465861b6e
					
				
					 2 changed files with 61 additions and 6 deletions
				
			
		
							
								
								
									
										49
									
								
								.config/i3/scripts/notify.sh
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										49
									
								
								.config/i3/scripts/notify.sh
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,49 @@ | |||
| #!/bin/bash | ||||
| # Show system status in notification, or your own message | ||||
| # Syntaxis: notify [-vb] <message> | ||||
| 
 | ||||
| # Variables | ||||
| duration=3 | ||||
| bright='' | ||||
| vol='' | ||||
| title='' | ||||
| message='' | ||||
| 
 | ||||
| # Functions | ||||
| function getVol () { | ||||
| 	status=$(amixer get Master | grep "^  Front Left" | cut -d ' ' -f 8) | ||||
| 	if [[ $status == "[on]" ]] ; then  | ||||
| 		vol=$(amixer get Master | grep -o "[0-9]*%" | head -n 1) | ||||
| 	else | ||||
| 		vol="0%" | ||||
| 	fi | ||||
| } ; export -f getVol | ||||
| 
 | ||||
| # Get options | ||||
| while getopts ":bvm:" options; do | ||||
| 	case "${options}" in  | ||||
| 		b) 	 | ||||
| 			bright=$(brightnessctl | grep -o "[0-9]*%") | ||||
| 			title="Brightness: ${bright}" | ||||
| 			;; | ||||
| 		v) | ||||
| 		        getVol | ||||
| 			title="Volume: ${vol:-'0%'}" | ||||
| 			;; | ||||
| 		m)  | ||||
| 			message=${OPTARG} | ||||
| 			;; | ||||
| 		*)	 | ||||
| 			title="Unknown option" | ||||
| 			;; | ||||
| 	esac | ||||
| done | ||||
| 
 | ||||
| shift $((OPTIND - 1)) | ||||
| 
 | ||||
| notify-send "${title:-${message}}" "${message}" \ | ||||
| 	-h int:x:100 -h int:y:100 \ | ||||
| 	-h string:x-canonical-private-synchronous:byMe # Replace if not yet gone | ||||
| 
 | ||||
| # sleep ${duration}; killall notify-osd | ||||
| 
 | ||||
							
								
								
									
										18
									
								
								Guide.md
									
										
									
									
									
								
							
							
						
						
									
										18
									
								
								Guide.md
									
										
									
									
									
								
							|  | @ -4,12 +4,6 @@ Complete (but currently incomplete) guide to installing my systems. | |||
| 
 | ||||
| ## Base system: Manjaro | ||||
| 
 | ||||
| ## Connections | ||||
| 
 | ||||
| ``` | ||||
| pacman -S network-manager-applet nm-connection-editor blueman | ||||
| ``` | ||||
| 
 | ||||
| ## Window manager: i3 | ||||
| 
 | ||||
| ``` | ||||
|  | @ -21,6 +15,18 @@ Take the following config files | |||
| - [i3 config folder](./.config/i3/) | ||||
| - | ||||
| 
 | ||||
| ## Connections | ||||
| 
 | ||||
| ``` | ||||
| pacman -S network-manager-applet nm-connection-editor blueman | ||||
| ``` | ||||
| 
 | ||||
| ## Notifications | ||||
| 
 | ||||
| ``` | ||||
| pacman -S dunst | ||||
| ``` | ||||
| 
 | ||||
| ## Install additional software | ||||
| 
 | ||||
| ``` | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue