rose-pine-tty/generate.sh

46 lines
1.0 KiB
Bash
Executable File

#!/usr/bin/env bash
ProgName="$(basename -- "$0")"
ScriptDir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
sub_help() {
echo "Usage: $ProgName <theme>"
echo "Available themes:"
echo " default"
echo " moon"
echo " dawn"
}
subcommand="$1"
case "$subcommand" in
"-h" | "--help")
sub_help
exit
;;
"" | default | moon | dawn)
if [ "$subcommand" == "" ] || [ "$subcommand" == "default" ]; then
. "${ScriptDir}/themes/rose-pine.sh" || exit 1
else
# shellcheck source=themes/rose-pine.sh
. "${ScriptDir}/themes/rose-pine-${subcommand}.sh" || exit 1
fi
default_red=()
default_grn=()
default_blu=()
IFS=','
for i in "${colors[@]}"; do
read -r r g b <<<"$i"
default_red+=("$r")
default_grn+=("$g")
default_blu+=("$b")
done
echo "vt.default_red=${default_red[*]} vt.default_grn=${default_grn[*]} vt.default_blu=${default_blu[*]}"
unset IFS
;;
*)
echo "Error: '$subcommand' is not a known theme." >&2
echo "Run '$ProgName --help' for help." >&2
exit 1
;;
esac