45 lines
1003 B
Bash
Executable File
45 lines
1003 B
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
|
|
. "${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
|