-
Notifications
You must be signed in to change notification settings - Fork 0
/
generate.sh
executable file
路63 lines (52 loc) 路 1.29 KB
/
generate.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
DIR="$(dirname "$0")"
FileList=("$DIR"/*.conf)
TargetFolder="$DIR"/../colorschemes
OutPutFile=
NAME=
# reads config file and writes theme file
# input: config file
# output: theme file
function buildTheme {
CONFIGFILE="$1"
# shellcheck source=dark-medium.conf
source "$CONFIGFILE"
if [ ! -d "$TargetFolder" ]; then
mkdir "$TargetFolder"
fi
NAME=$(basename -- "$CONFIGFILE")
NAME="${NAME%.*}"
OutPutFile=$TargetFolder/everforest-${NAME}.theme
echo writing "${NAME}".theme in "$TargetFolder"
# map everforest to terminal colors
XBlack=$bg_dim
XRed=$red
XGreen=$green
XYellow=$yellow
XBlue=$blue
XMagenta=$purple
XCyan=$aqua
XLightGray=$grey2
XDarkGray=$grey0
XLightRed=$red
XLightGreen=$green
XLightYellow=$yellow
XLightBlue=$blue
XLightMagenta=$purple
XLightCyan=$aqua
XLightWhite=$fg
# write to file
cat << EOF > "$OutPutFile"
# https://github.com/sainnhe/everforest
[Scheme]
Name=Everforest-$NAME
ColorForeground=$fg
ColorBackground=$bg0
TabActivityColor=$orange
ColorSelectionUseDefault=FALSE
ColorSelectionBackground=$bg_visual
ColorPalette=$XBlack;$XRed;$XGreen;$XYellow;$XBlue;$XMagenta;$XCyan;$XLightGray;$XDarkGray;$XLightRed;$XLightGreen;$XLightYellow;$XLightBlue;$XLightMagenta;$XLightCyan;$XLightWhite
EOF
}
# loop over all config files
for i in "${FileList[@]}"; do buildTheme "$i"; done