little hacks for almalinux

This commit is contained in:
Anton Volnuhin 2024-05-22 20:26:53 +03:00
parent 9966178c66
commit 4440da8609

View File

@ -35,17 +35,12 @@ $Green""########################################################################
"
read
{{ if eq .chezmoi.osRelease.id "almalinux" -}}
echo "Installing prerequestative ncurses for this script's interface"|awk '{print $Gray$0$NC}'|sed "s/^/$PADDING/"
sudo dnf install ncurses -y 2>&1|awk '{print $Gray$0$NC}'|sed "s/^/$PADDING/"
{{ end -}}
#Setup
TERM_WIDTH_BASE=$(tput cols)
LINES=$(tput lines)
TERM_WIDTH_BASE=$(stty size|awk '{print $2}')
PADDING=$(printf "%${PAD_LEN}s") # 4 spaces of padding
TERM_WIDTH=$(($TERM_WIDTH_BASE - $PAD_LEN))
USER=$(whoami)
STEP=1
@ -90,14 +85,20 @@ new_line () {
}
pad() {
local PADDING=$(printf "%${PAD_LEN}s") # 4 spaces of padding
local TERM_WIDTH=$(($TERM_WIDTH_BASE - $PAD_LEN))
while IFS= read -r line; do
echo -e $Gray$line$NC | fold -s -w $TERM_WIDTH | sed "s/^/$PADDING/"
done
}
{{ if eq .chezmoi.osRelease.id "almalinux" -}}
echo "Installing prerequestative ncurses for this script's interface"|pad
sudo dnf install ncurses -y 2>&1|pad
{{ end -}}
LINES=$(tput lines)
print_block