Bash3lper/header

93 lines
1.9 KiB
Plaintext
Raw Permalink Normal View History

2023-03-29 20:10:53 +02:00
#!/usr/bin/env bash
#
# Header
#
LSB=/usr/bin/lsb_release
readonly PROGNAME=$(basename $0)
readonly PROGDIR=$(readlink -m $(dirname $0))
readonly ARGS="$@"
Bash3lper="$(cd "$(dirname "$0")" && pwd)"
# Bscripts="scripts"
#### Color definition
GREEN="$(tput setaf 2)"
PINK="$(tput setaf 5)"
BLUE="$(tput setaf 6)"
RED="$(tput setaf 1)"
YELLOW="$(tput setaf 3)"
ORANGE="\e[38;5;202m"
ORANGE1="$(tput setaf 166)"
GRIS="\e[38;5;8m"
#GRIS="$(tput setaf 246)"
NOC="$(tput sgr0)"
pause_quit(){
echo -e "$(tput setaf 3)"
local message="$@"
[ -z "$message" ] && message=" Press [Enter] to quit..."
read -r -p "$message" readEnterKey ; exit 0
echo -e "$(tput sgr0)"
clear
# exit 0
}
# Return
pause(){
echo -e "$(tput setaf 3)"
local message="$@"
[ -z "$message" ] && message=" Press [Enter] key to continue..."
read -r -p "$message" readEnterKey
echo -e "$(tput sgr0)"
clear
# exit 0
}
## Header ascii
write_header_acsii(){
cat <<- "EOFB"
____ _ ____ _
| _ \ | | |___ \| |
| |_) | __ _ ___| |__ __) | |_ __ ___ _ __
| _ < / _` / __| '_ \ |__ <| | '_ \ / _ \ '__|
| |_) | (_| \__ \ | | |___) | | |_) | __/ |
|____/ \__,_|___/_| |_|____/|_| .__/ \___|_|
| |
|_|
EOFB
}
##### Header
write_header(){
tput clear
local h="$@"
# Move cursor to screen location Y,X (top left is 0,0)
tput cup 0 16
tput setaf 6
write_header_acsii
tput sgr0
tput cup 7 12
# Set a foreground colour using ANSI escape
tput setaf 3
echo " "
tput sgr0
tput cup 7 42
# Set a foreground colour using ANSI escape
tput setaf 3
echo " V0.32"
tput sgr0
# Set reverse video mode
tput cup 11 9
tput rev
echo -e "${h}"
tput sgr0
# rc revenir position initial
#tput rc
#tput cup 13 16
}
write_header