Rewrote header auto-resizing using FormatUtils.
This commit is contained in:
parent
a0ac4510e0
commit
33c26d3444
27
fluxion.sh
27
fluxion.sh
|
@ -225,16 +225,15 @@ trap handle_exit SIGINT SIGHUP
|
||||||
# Design
|
# Design
|
||||||
function fluxion_header() {
|
function fluxion_header() {
|
||||||
conditional_clear
|
conditional_clear
|
||||||
local headerWidth=$(($(tput cols) - 2))
|
format_autosize "[%*s]\n"
|
||||||
local headerMessage="${CRed}FLUXION $FLUXIONVersion ${CRed}< F${CYel}luxion ${CRed}I${CYel}s ${CRed}T${CYel}he ${CRed}F${CYel}uture >"
|
local verticalBorder=$FormatAutosize
|
||||||
local headerMessageEscaped=$(echo "$headerMessage" | sed -r 's/\\(e|033)\[[0-9];?[0-9]*m//g')
|
echo -e "`printf "$CRed$verticalBorder" "" | sed -r "s/ /~/g"`"
|
||||||
local headerMessageWidth=${#headerMessageEscaped}
|
printf "$CRed$verticalBorder" ""
|
||||||
local headerMessagePadding=$(($(($headerWidth - $headerMessageWidth)) / 2))
|
format_autosize "[%*s${CRed}FLUXION $FLUXIONVersion ${CRed}< F${CYel}luxion ${CRed}I${CYel}s ${CRed}T${CYel}he ${CRed}F${CYel}uture >%*s$CBlu]\n"; printf "$FormatAutosize" "" ""
|
||||||
echo -e "`printf "$CRed[%${headerWidth}s]\n" "" | sed -r "s/ /~/g"`"
|
printf "$CBlu$verticalBorder" ""
|
||||||
echo -e "`printf "$CRed[%${headerWidth}s]\n" ""`"
|
echo -e "`printf "$CBlu$verticalBorder" "" | sed -r "s/ /~/g"`$CClr"
|
||||||
echo -e "`printf "$CRed[%${headerMessagePadding}s%b%${headerMessagePadding}s$CBlu]\n" "" "$headerMessage" ""`"
|
echo
|
||||||
echo -e "`printf "$CBlu[%${headerWidth}s]\n" ""`"
|
echo
|
||||||
echo -e "`printf "$CBlu[%${headerWidth}s]\n$CClr" "" | sed -r "s/ /~/g"`"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
####################################### < Start > ######################################
|
####################################### < Start > ######################################
|
||||||
|
@ -283,10 +282,10 @@ if [ ! $FLUXIONDebug ]; then
|
||||||
format_center " ⌡▓ ⌡◘▒▓▒ ⌡◘▒▓▒◘ └▓/ \▓┘ ⌡▓╝ ⌡◙▒▓▒◙ ⌡▓ \▓┘"; FLUXIONBanner[${#FLUXIONBanner[@]}]="$FormatCenter";
|
format_center " ⌡▓ ⌡◘▒▓▒ ⌡◘▒▓▒◘ └▓/ \▓┘ ⌡▓╝ ⌡◙▒▓▒◙ ⌡▓ \▓┘"; FLUXIONBanner[${#FLUXIONBanner[@]}]="$FormatCenter";
|
||||||
format_center "¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯"; FLUXIONBanner[${#FLUXIONBanner[@]}]="$FormatCenter";
|
format_center "¯¯¯ ¯¯¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯ ¯¯¯ ¯¯¯¯ ¯¯¯¯¯¯¯ ¯¯¯¯¯¯¯¯"; FLUXIONBanner[${#FLUXIONBanner[@]}]="$FormatCenter";
|
||||||
|
|
||||||
for line in "${FLUXIONBanner[@]}"; do
|
#for line in "${FLUXIONBanner[@]}"; do
|
||||||
echo "$line"; sleep 0.1
|
# echo "$line"; sleep 0.01
|
||||||
done
|
#done
|
||||||
|
echo "${FLUXIONBanner[@]}"
|
||||||
echo
|
echo
|
||||||
|
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
|
|
Loading…
Reference in New Issue