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 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 #Setup
TERM_WIDTH_BASE=$(tput cols) TERM_WIDTH_BASE=$(stty size|awk '{print $2}')
LINES=$(tput lines) PADDING=$(printf "%${PAD_LEN}s") # 4 spaces of padding
TERM_WIDTH=$(($TERM_WIDTH_BASE - $PAD_LEN))
USER=$(whoami) USER=$(whoami)
STEP=1 STEP=1
@ -90,14 +85,20 @@ new_line () {
} }
pad() { 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 while IFS= read -r line; do
echo -e $Gray$line$NC | fold -s -w $TERM_WIDTH | sed "s/^/$PADDING/" echo -e $Gray$line$NC | fold -s -w $TERM_WIDTH | sed "s/^/$PADDING/"
done 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 print_block