Add debug function

This commit is contained in:
Jeremy Gardais 2020-08-21 20:02:03 +02:00
parent 86d334ca21
commit 3b5b7aac64
Signed by: jegardai
GPG Key ID: E759BAA22501AF32
1 changed files with 25 additions and 2 deletions

27
ecran
View File

@ -3,9 +3,32 @@
# Description: Manage video output (size, orientation, ...) # Description: Manage video output (size, orientation, ...)
# And reload wm configuration # And reload wm configuration
# First and main screen (laptop screen,…) # Vars {{{
MAIN_SCREEN="LVDS-1" ## 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 case "${1}" in
ds | dockstation | work ) ds | dockstation | work )