1
0
mirror of https://github.com/Mayccoll/Gogh.git synced 2023-08-10 21:12:46 +03:00

theme json generator

This commit is contained in:
Mayccoll 2020-12-17 17:47:38 -05:00
parent 100e6e59da
commit db74cdd14e
4 changed files with 4435 additions and 1 deletions

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ gh-pages/node_modules
*lock* *lock*
.stfolder .stfolder
apply-colors-original.sh apply-colors-original.sh
.tmp

View File

@ -160,4 +160,12 @@ There is no blue without yellow and without orange.
## Themes in `json` format ## Themes in `json` format
https://gist.github.com/rapgru/09b449285231d18f4e4536c5f48fc927 In your terminal type:
```bash
bash tools/generate.sh
```
this generates a json file located at `gh-pages/data/themes.json`
orginal script source: https://gist.github.com/rapgru/09b449285231d18f4e4536c5f48fc927

4360
gh-pages/data/themes.json Normal file

File diff suppressed because it is too large Load Diff

65
tools/generate.sh Normal file
View File

@ -0,0 +1,65 @@
#!/bin/bash
# |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░|
# | ······· Colors
# |░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░|
RS="\e[0m"
# Basic Colors
BLACK="\e[0;30m"
RED="\e[0;31m"
GREEN="\e[0;32m"
YELLOW="\e[0;33m"
BLUE="\e[0;34m"
PURPLE="\e[0;35m"
CYAN="\e[0;36m"
WHITE="\e[0;37m"
# |
# | ::::::: Script Path
# |
SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
createColors() {
source $1
echo ' {'
echo ' "name": "'"$PROFILE_NAME"'",'
echo ' "black": "'"$COLOR_01"'",'
echo ' "red": "'"$COLOR_02"'",'
echo ' "green": "'"$COLOR_03"'",'
echo ' "yellow": "'"$COLOR_04"'",'
echo ' "blue": "'"$COLOR_05"'",'
echo ' "purple": "'"$COLOR_06"'",'
echo ' "cyan": "'"$COLOR_07"'",'
echo ' "white": "'"$COLOR_08"'",'
echo ' "brightBlack": "'"$COLOR_09"'",'
echo ' "brightRed": "'"$COLOR_10"'",'
echo ' "brightGreen": "'"$COLOR_11"'",'
echo ' "brightYellow": "'"$COLOR_12"'",'
echo ' "brightBlue": "'"$COLOR_13"'",'
echo ' "brightPurple": "'"$COLOR_14"'",'
echo ' "brightCyan": "'"$COLOR_15"'",'
echo ' "brightWhite": "'"$COLOR_16"'",'
echo ' "foreground": "'"$FOREGROUND_COLOR"'",'
echo ' "background": "'"$BACKGROUND_COLOR"'",'
echo ' "cursorColor": "'"$CURSOR_COLOR"'"'
echo ' },'
}
mkdir -p $SCRIPT_PATH/../.tmp
echo '{' > $SCRIPT_PATH/../gh-pages/data/themes.json
echo ' "themes": [' >> $SCRIPT_PATH/../gh-pages/data/themes.json
ls -1 $SCRIPT_PATH/../themes/*.sh | while read a; do grep "export" $a > "${a/themes/.tmp}"; done
ls -1 $SCRIPT_PATH/../.tmp/*.sh | while read a; do sed -i /IMPORTANT/d "${a}"; done
ls -1 $SCRIPT_PATH/../.tmp/*.sh | while read a; do createColors "$a" >> $SCRIPT_PATH/../gh-pages/data/themes.json; done
echo ' ]' >> $SCRIPT_PATH/../gh-pages/data/themes.json
echo '}' >> $SCRIPT_PATH/../gh-pages/data/themes.json
echo ""
echo "File location:"
echo -e "${GREEN} gh-pages/data/themes.json"