Add debug function
This commit is contained in:
		
							parent
							
								
									86d334ca21
								
							
						
					
					
						commit
						3b5b7aac64
					
				
							
								
								
									
										27
									
								
								ecran
								
								
								
								
							
							
						
						
									
										27
									
								
								ecran
								
								
								
								
							|  | @ -3,9 +3,32 @@ | |||
| # Description:      Manage video output (size, orientation, ...) | ||||
| #                   And reload wm configuration | ||||
| 
 | ||||
| # First and main screen (laptop screen,…) | ||||
| MAIN_SCREEN="LVDS-1" | ||||
| # Vars {{{ | ||||
| ## First and main screen (laptop screen,…) | ||||
| readonly MAIN_SCREEN="LVDS-1" | ||||
| 
 | ||||
| [ -z "${DEBUG}" ] && readonly DEBUG=0 | ||||
| 
 | ||||
| ## Colors | ||||
| readonly PURPLE='\033[1;35m' | ||||
| readonly RED='\033[0;31m' | ||||
| readonly RESET='\033[0m' | ||||
| readonly COLOR_DEBUG="${PURPLE}" | ||||
| # }}} | ||||
| 
 | ||||
| # Functions {{{ | ||||
| debug_message() {                                               # {{{ | ||||
| 
 | ||||
| 	local_message="${1}" | ||||
| 
 | ||||
| 	## Print message if DEBUG is enable (=0) | ||||
| 	[ "${DEBUG}" -eq "0" ] && printf '\e[1;35m%-6b\e[m\n' "DEBUG − ${PROGNAME}: ${local_message}" | ||||
| 
 | ||||
| 	return 0 | ||||
| } | ||||
| # }}} | ||||
| 
 | ||||
| # }}} | ||||
| 
 | ||||
| case "${1}" in | ||||
| 	ds | dockstation | work ) | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue