rose-pine-tty/generate.sh

46 lines
1.0 KiB
Bash
Raw Normal View History

#!/usr/bin/env bash
2023-05-27 11:40:10 +00:00
ProgName="$(basename -- "$0")"
2023-12-27 00:58:05 +00:00
ScriptDir=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
2023-05-27 11:40:10 +00:00
sub_help() {
echo "Usage: $ProgName <theme>"
echo "Available themes:"
2023-12-27 00:58:05 +00:00
echo " default"
echo " moon"
echo " dawn"
2023-05-27 11:40:10 +00:00
}
subcommand="$1"
case "$subcommand" in
2023-12-27 00:58:05 +00:00
"-h" | "--help")
sub_help
exit
;;
"" | default | moon | dawn)
if [ "$subcommand" == "" ] || [ "$subcommand" == "default" ]; then
. "${ScriptDir}/themes/rose-pine.sh" || exit 1
else
2023-12-27 01:42:32 +00:00
# shellcheck source=themes/rose-pine.sh
2023-12-27 00:58:05 +00:00
. "${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
;;
2023-05-27 11:40:10 +00:00
esac