···11+# Puts the hex and rgb values of the same color on the same line in order
22+33+{bg_color} {bg_color.rgb}
44+{fg_color} {fg_color.rgb}
55+{color0} {color0.rgb}
66+{color1} {color1.rgb}
77+{color2} {color2.rgb}
88+{color3} {color3.rgb}
99+{color4} {color4.rgb}
1010+{color5} {color5.rgb}
1111+{color6} {color6.rgb}
1212+{color7} {color7.rgb}
1313+{color8} {color8.rgb}
1414+{color9} {color9.rgb}
1515+{color10} {color10.rgb}
1616+{color11} {color11.rgb}
1717+{color12} {color12.rgb}
1818+{color13} {color13.rgb}
1919+{color14} {color14.rgb}
2020+{color1} {color1.rgb}
···113113 " "$t" > "${dest_dir}/${file_name}"
114114done
115115116116+# This allows for different configuration for different color schemes.
117117+# Configuration for one theme may not work very well for another theme. To use
118118+# this set theme_type in the theme file to any string and place theme specific
119119+# configuration in `${XDG_CONFIG_HOME:-$HOME/.config}/thm/templates/$theme_type`.
120120+# If not specified, only templates in the base template directory will be generated.
121121+# This will overwrite previously generated template files.
122122+[ "$theme_type" ] && [ -d "${conf_dir}/templates/$theme_type" ] && \
123123+ for t in "${conf_dir}/templates/$theme_type/"*".template"
124124+ do
125125+ file_name=${t##*/}
126126+ file_name=${file_name%.template}
127127+128128+ sed "
129129+ s/{bg_color}/$bg_color/g
130130+ s/{fg_color}/$fg_color/g
131131+ s/{color0}/$color0/g
132132+ s/{color1}/$color1/g
133133+ s/{color2}/$color2/g
134134+ s/{color3}/$color3/g
135135+ s/{color4}/$color4/g
136136+ s/{color5}/$color5/g
137137+ s/{color6}/$color6/g
138138+ s/{color7}/$color7/g
139139+ s/{color8}/$color8/g
140140+ s/{color9}/$color9/g
141141+ s/{color10}/$color10/g
142142+ s/{color11}/$color11/g
143143+ s/{color12}/$color12/g
144144+ s/{color13}/$color13/g
145145+ s/{color14}/$color14/g
146146+ s/{color15}/$color15/g
147147+ s/{bg_color.rgb}/$bg_color_rgb/g
148148+ s/{fg_color.rgb}/$fg_color_rgb/g
149149+ s/{color0.rgb}/$color0_rgb/g
150150+ s/{color1.rgb}/$color1_rgb/g
151151+ s/{color2.rgb}/$color2_rgb/g
152152+ s/{color3.rgb}/$color3_rgb/g
153153+ s/{color4.rgb}/$color4_rgb/g
154154+ s/{color5.rgb}/$color5_rgb/g
155155+ s/{color6.rgb}/$color6_rgb/g
156156+ s/{color7.rgb}/$color7_rgb/g
157157+ s/{color8.rgb}/$color8_rgb/g
158158+ s/{color9.rgb}/$color9_rgb/g
159159+ s/{color10.rgb}/$color10_rgb/g
160160+ s/{color11.rgb}/$color11_rgb/g
161161+ s/{color12.rgb}/$color12_rgb/g
162162+ s/{color13.rgb}/$color13_rgb/g
163163+ s/{color14.rgb}/$color14_rgb/g
164164+ s/{color15.rgb}/$color15_rgb/g
165165+ " "$t" > "${dest_dir}/${file_name}"
166166+ done
167167+116168# Run extra user scripts
117169[ -d "$conf_dir/scripts" ] || exit 0
118170for i in "$conf_dir/scripts/"*