Add Display Functionality

This commit is contained in:
OBJNULL 2026-05-08 12:38:20 -05:00
parent 53eba288b3
commit d816c93c30

View file

@ -23,7 +23,7 @@ function styleColor {
function styleColorRst { function styleColorRst {
echo -e "\e[0m" echo -e "\e[0m"
} }
function styleTitle { function displayTitle {
# Arguments # Arguments
title=$1 title=$1
@ -34,11 +34,33 @@ function styleTitle {
bars="${bars}-" bars="${bars}-"
done done
bars="${bars}+" bars="${bars}+"
echo -e "\t${bars}" echo -e "\n\n\t${bars}"
echo -e "\t| $(styleColor "purple")${title}$(styleColorRst) |" echo -e "\t| $(styleColor "purple")${title}$(styleColorRst) |"
echo -e "\t${bars}" echo -e "\t${bars}\n\n"
}
function displayQuestion {
printf>&2 "$(styleColor "blue")$1$(styleColorRst) $(styleColor "cyan")[$2]$(styleColorRst): "
read -r response
echo ${response}
}
function displayYesNo {
response=$(displayQuestion "$1" "y/N")
if [ "$response" == "y" ] || [ "$response" == "Y" ]; then
echo "yes"
else
echo "no"
fi
} }
# Packages # Packages
# --- Entry Point --- # --- Entry Point ---
styleTitle "OBJNULL Dotfile Installer" clear
displayTitle "OBJNULL Dotfile Installer"
echo -e "This script is designed to quickly install any required components"
echo -e "so that your system is up and running quick with a speedy shell.\n"
response=$(displayYesNo "Continue")
if [ ${response} != "yes" ]; then
echo -e "$(styleColor "red")Goodbye...$(styleColorRst)"
fi