You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
1.8 KiB

#!/bin/bash
GRAPHICS_SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source $GRAPHICS_SCRIPT_DIR/colors.sh
intro_decoration_line='-'
header_decoration_line='#'
header_decoration_side='#'
graphics_input_prompt()
{
color_start "themeUserInput"
printf "$1"
color_stop
}
graphics_install_prompt()
{
color_start "themeInstall"
echo "$1"
color_stop
}
graphics_comment()
{
color_start "themeComment"
echo "$1"
color_stop
}
graphics_line_hor()
{
for (( i=1 ; i<=$1 ; i++ ));
do
printf "$2"
done
printf "\n"
}
graphics_header()
{
color_start "themeGreetings"
theMessage="$1"
theLenght=${#theMessage}
theLenght=$(( $theLenght + 4))
graphics_line_hor "$theLenght" "$header_decoration_line"
printf "$header_decoration_side "
printf "$1"
printf " $header_decoration_side"
printf "\n"
graphics_line_hor "$theLenght" "$header_decoration_line"
color_stop
}
graphics_success()
{
color_start "themeSuccess"
theMessage="$1"
theLenght=${#theMessage}
theLenght=$(( $theLenght + 4))
graphics_line_hor "$theLenght" "$header_decoration_line"
printf "$header_decoration_side "
printf "$1"
printf " $header_decoration_side"
printf "\n"
graphics_line_hor "$theLenght" "$header_decoration_line"
color_stop
}
graphics_error()
{
color_start "themeError"
theMessage="$1"
theLenght=${#theMessage}
theLenght=$(( $theLenght + 4))
graphics_line_hor "$theLenght" "$header_decoration_line"
printf "$header_decoration_side "
printf "$1"
printf " $header_decoration_side"
printf "\n"
graphics_line_hor "$theLenght" "$header_decoration_line"
color_stop
}
graphics_indication()
{
color_start "themeIndication"
theMessage="$1"
theLenght=${#theMessage}
graphics_line_hor "$theLenght" "$intro_decoration_line"
printf "$1"
printf "\n"
graphics_line_hor "$theLenght" "$intro_decoration_line"
color_stop
}