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

fixed minor naming issue and added more descriptive comments. Also silenced grep

This commit is contained in:
polemon 2019-03-19 13:13:28 +01:00
parent ef542815c4
commit 873f615539

View File

@ -535,6 +535,7 @@ apply_xfce4-terminal() {
[[ -d "${SCHEMEDIR}" ]] || mkdir -p "${SCHEMEDIR}"
F_NAME=${PROFILE_NAME// /-}
F_NAME=$(echo ${F_NAME} | tr -d ":()")
F_NAME=$(echo "${F_NAME}" | awk '{print tolower($0)}')
FF_NAME="${SCHEMEDIR}/${F_NAME}.theme"
@ -545,6 +546,8 @@ apply_xfce4-terminal() {
L_COLORPALETTE="ColorPalette=${COLOR_01};${COLOR_02};${COLOR_03};${COLOR_04};${COLOR_05};${COLOR_06};${COLOR_07};${COLOR_08};${COLOR_09};${COLOR_10};${COLOR_11};${COLOR_12};${COLOR_13};${COLOR_14};${COLOR_15};${COLOR_16}"
printf '%s\n' \
"; Generated by Gogh" \
"; https://mayccoll.github.io/Gogh" \
"[Scheme]" \
"Name=${PROFILE_NAME}" \
"ColorForeground=${FOREGROUND_COLOR}" \
@ -558,31 +561,31 @@ apply_xfce4-terminal() {
# any of the themes in there. The color settings need to
# be written there directly.
if ((LOOP == OPTLENGTH)); then
if grep "^ColorPalette=" "${CONFFILE}"; then
if grep -q "^ColorPalette=" "${CONFFILE}"; then
sed -i -r -e "s/^ColorPalette=.*/${L_COLORPALETTE}/" "${CONFFILE}"
else
echo "${L_COLORPALETTE}" >> "${CONFFILE}"
fi
if grep "^ColorCursor=" "${CONFFILE}"; then
if grep -q "^ColorCursor=" "${CONFFILE}"; then
sed -i -r -e "s/^ColorCursor=.*/${L_COLORCURSOR}/" "${CONFFILE}"
else
echo "${L_COLORCURSOR}" >> "${CONFFILE}"
fi
if grep "^ColorForeground=" "${CONFFILE}"; then
if grep -q "^ColorForeground=" "${CONFFILE}"; then
sed -i -r -e "s/^ColorForeground=.*/ColorForeground=${FOREGROUND_COLOR}/" "${CONFFILE}"
else
echo "ColorForeground=${FOREGROUND_COLOR}" >> "${CONFFILE}"
fi
if grep "^ColorBackground=" "${CONFFILE}"; then
if grep -q "^ColorBackground=" "${CONFFILE}"; then
sed -i -r -e "s/^ColorBackground=.*/ColorBackground=${BACKGROUND_COLOR}/" "${CONFFILE}"
else
echo "ColorBackground=${BACKGROUND_COLOR}" >> "${CONFFILE}"
fi
if grep "^ColorCursorUseDefault=FALSE" "${CONFFILE}"; then
if grep -q "^ColorCursorUseDefault=FALSE" "${CONFFILE}"; then
true
else
echo "ColorCursorUseDefault=FALSE" >> "${CONFFILE}"