This repository has been archived on 2024-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
dotfiles/env/common/colors/generator/gen.bash

48 lines
1.4 KiB
Bash
Raw Normal View History

2017-02-07 16:16:45 -06:00
#!/usr/bin/env bash
SCHEME="donokai"
2019-01-22 19:37:40 -06:00
TYPE="dark"
2019-02-02 12:12:35 -06:00
# v=$(ruby --version)
2017-02-07 16:16:45 -06:00
if [[ $? -eq 0 ]]; then
2019-01-22 19:37:40 -06:00
if [[ -n $1 ]]; then SCHEME=$1; fi
if [[ -n $2 ]]; then TYPE=$2; fi
2017-02-07 16:16:45 -06:00
DIR=$(cd "$(dirname "${BASH_SOURCE[0]}" )" && pwd)
2017-02-07 16:16:45 -06:00
mkdir -p "$DIR/vendor"
2017-02-07 16:16:45 -06:00
B16_DIR="$DIR/vendor/base16-builder"
2017-02-07 16:16:45 -06:00
COLORS_PATH="$B16_DIR/output"
if [ -d "$B16_DIR" ]; then
echo "Skipping repo pull down..."
rm -rf "$COLORS_PATH"
mkdir -p "$COLORS_PATH"
else
git clone https://github.com/lytedev/base16-builder.git "$DIR/vendor/base16-builder"
2017-02-07 16:16:45 -06:00
fi
"$DIR/vendor/base16-builder/base16" -t vim -s "$DIR/schemes/$SCHEME.yml"
"$DIR/vendor/base16-builder/base16" -t vconsole -s "$DIR/schemes/$SCHEME.yml"
"$DIR/vendor/base16-builder/base16" -t xresources -s "$DIR/schemes/$SCHEME.yml"
"$DIR/vendor/base16-builder/base16" -t shell -s "$DIR/schemes/$SCHEME.yml"
2017-02-07 16:16:45 -06:00
# replace existing color files
rm -f "$DIR/../shell"
rm -f "$DIR/../vconsole"
rm -f "$DIR/../vim"
rm -f "$DIR/../xresources"
2019-01-22 19:37:40 -06:00
cp "$COLORS_PATH/xresources/base16-$SCHEME.$TYPE.xresources" "$DIR/../xresources"
cp "$COLORS_PATH/vconsole/base16-$SCHEME.$TYPE.sh" "$DIR/../vconsole"
cp "$COLORS_PATH/vim/base16-$SCHEME.vim" "$DIR/../vim"
2019-01-22 19:37:40 -06:00
cp "$COLORS_PATH/shell/base16-$SCHEME.$TYPE.sh" "$DIR/../shell"
chmod +x "$DIR/../shell"
chmod +x "$DIR/../vconsole"
2017-02-07 16:16:45 -06:00
echo "Colors have been regenerated. You will need to re-link them."
2017-02-07 16:16:45 -06:00
else
echo "Ruby isn't installed."
fi