60 lines
2.2 KiB
Bash
60 lines
2.2 KiB
Bash
#!/bin/bash
|
|
|
|
source ./scripts/variables
|
|
|
|
_template() {
|
|
sed -i "s|{{foreground}}|$foreground|" "$1"
|
|
sed -i "s|{{foreground_light}}|$foreground_light|" "$1"
|
|
sed -i "s|{{foreground_lighter}}|$foreground_lighter|" "$1"
|
|
sed -i "s|{{background}}|$background|" "$1"
|
|
sed -i "s|{{background_light}}|$background_light|" "$1"
|
|
sed -i "s|{{background_dark}}|$background_dark|" "$1"
|
|
sed -i "s|{{background_darker}}|$background_darker|" "$1"
|
|
sed -i "s|{{cursor_color}}|$cursor_color|" "$1"
|
|
sed -i "s|{{color0}}|$color0|" "$1"
|
|
sed -i "s|{{color8}}|$color8|" "$1"
|
|
sed -i "s|{{color1}}|$color1|" "$1"
|
|
sed -i "s|{{color9}}|$color9|" "$1"
|
|
sed -i "s|{{color2}}|$color2|" "$1"
|
|
sed -i "s|{{color10}}|$color10|" "$1"
|
|
sed -i "s|{{color3}}|$color3|" "$1"
|
|
sed -i "s|{{color11}}|$color11|" "$1"
|
|
sed -i "s|{{color4}}|$color4|" "$1"
|
|
sed -i "s|{{color12}}|$color12|" "$1"
|
|
sed -i "s|{{color5}}|$color5|" "$1"
|
|
sed -i "s|{{color13}}|$color13|" "$1"
|
|
sed -i "s|{{color6}}|$color6|" "$1"
|
|
sed -i "s|{{color14}}|$color14|" "$1"
|
|
sed -i "s|{{color7}}|$color7|" "$1"
|
|
sed -i "s|{{color15}}|$color15|" "$1"
|
|
}
|
|
|
|
_kernel_colors() {
|
|
transform_colors ()
|
|
{
|
|
printf "%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d" \
|
|
"0x$(cut -c "$1" <<< "${color0}")" \
|
|
"0x$(cut -c "$1" <<< "${color1}")" \
|
|
"0x$(cut -c "$1" <<< "${color2}")" \
|
|
"0x$(cut -c "$1" <<< "${color3}")" \
|
|
"0x$(cut -c "$1" <<< "${color4}")" \
|
|
"0x$(cut -c "$1" <<< "${color5}")" \
|
|
"0x$(cut -c "$1" <<< "${color6}")" \
|
|
"0x$(cut -c "$1" <<< "${color7}")" \
|
|
"0x$(cut -c "$1" <<< "${color8}")" \
|
|
"0x$(cut -c "$1" <<< "${color9}")" \
|
|
"0x$(cut -c "$1" <<< "${color10}")" \
|
|
"0x$(cut -c "$1" <<< "${color11}")" \
|
|
"0x$(cut -c "$1" <<< "${color12}")" \
|
|
"0x$(cut -c "$1" <<< "${color13}")" \
|
|
"0x$(cut -c "$1" <<< "${color14}")" \
|
|
"0x$(cut -c "$1" <<< "${color15}")"
|
|
}
|
|
printf "vt.default_red=%s vt.default_grn=%s vt.default_blu=%s" "$(transform_colors 1-2)" "$(transform_colors 3-4)" "$(transform_colors 5-6)"
|
|
}
|
|
|
|
_msg() { printf " --> %s\n" "$@"; }
|
|
_info() { printf "\e[1;34m==> Info : \e[0m%s\n" "$@"; }
|
|
_warn() { printf "\e[1;33m==> Warning : \e[0m%s\n" "$@"; }
|
|
_error() { printf "\e[1;31m==> Error : \e[0m%s\n" "$@"; }
|