diff --git a/README.md b/README.md index bc798d7..ae072bd 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,9 @@ Gogh ## :small_orange_diamond: [Visit the Website](http://mayccoll.github.io/Gogh) :small_orange_diamond: -## Color Scheme for Gnome Terminal, Pantheon Terminal and Tilix +## Color Scheme for Gnome Terminal, Pantheon Terminal, Tilix, and XFCE4 Terminal -Color Schemes For Ubuntu, Linux Mint, Elementary OS and all distributions that use gnome terminal, Pantheon Terminal or Tilix, initially inspired by Elementary OS Luna. Also work on iTerm for macOS. You can check some themes [here...](https://mayccoll.github.io/Gogh/) +Color Schemes For Ubuntu, Linux Mint, Elementary OS and all distributions that use Gnome Terminal, Pantheon Terminal, Tilix, or XFCE4 Terminal; initially inspired by Elementary OS Luna. Also works on iTerm for macOS. You can check-out the themes [here...](https://mayccoll.github.io/Gogh/) ![elementary](https://raw.githubusercontent.com/Mayccoll/Gogh/master/images/demos/themes.gif) @@ -24,13 +24,13 @@ Color Schemes For Ubuntu, Linux Mint, Elementary OS and all distributions that u ## [Install](https://github.com/Mayccoll/Gogh/blob/master/content/install.md) -Just copy and paste One line command. +Just copy and paste this one-line command: ```bash $ bash -c "$(wget -qO- https://git.io/vQgMr)" ``` -or if you are a mac user +Or, if you are a Mac user: ```bash $ bash -c "$(curl -sLo- https://git.io/vQgMr)" @@ -46,7 +46,7 @@ or if you are a mac user ## [Themes](https://mayccoll.github.io/Gogh/) -We have lots of themes. Check them out! [Here...](https://mayccoll.github.io/Gogh/) +We have lots of themes. Check them out [Here...](https://mayccoll.github.io/Gogh/)!
@@ -56,7 +56,7 @@ We have lots of themes. Check them out! [Here...](https://mayccoll.github.io/Gog ## [How to](https://github.com/Mayccoll/Gogh/blob/master/content/howto.md) -If you want to create your own color scheme or contribute to the project. [Here...](https://github.com/Mayccoll/Gogh/blob/master/content/howto.md) +If you want to create your own color scheme or contribute to the project, [start here](https://github.com/Mayccoll/Gogh/blob/master/content/howto.md). diff --git a/apply-colors.sh b/apply-colors.sh index cc17c9f..1dfc0e0 100644 --- a/apply-colors.sh +++ b/apply-colors.sh @@ -522,6 +522,88 @@ appy_tilixschemes() { fi } +apply_xfce4-terminal() { + # XFCE4 terminal has no profiles, instead it uses color presets + SCHEMEDIR="${HOME}/.local/share/xfce4/terminal/colorschemes" + CONFFILE="${HOME}/.config/xfce4/terminal/terminalrc" + + if [[ ! (-w "${CONFFILE}") ]]; then + echo "ERROR: config file not present or not writeable!" + exit 1 + fi + + [[ -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" + + touch "${FF_NAME}" + + L_COLORCURSOR="ColorCursor=${CURSOR_COLOR}" + 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}" \ + "ColorBackground=${BACKGROUND_COLOR}" \ + "${L_COLORCURSOR}" \ + "${L_COLORPALETTE}" \ + "ColorCursorUseDefault=FALSE" > ${FF_NAME} + + # apply last theme in queue + # xfce4-terminal monitors its rc file and doesn't reference + # any of the themes in there. The color settings need to + # be written there directly. + if ((LOOP == OPTLENGTH)); then + read -r -p "All done - apply new theme? [y/N] " -n 1 XFCE4_APPLY_CURR_THEME + if [[ ${XFCE4_APPLY_CURR_THEME::1} =~ ^(y|Y)$ ]]; then + if grep -q "^ColorPalette=" "${CONFFILE}"; then + sed -i -r -e "s/^ColorPalette=.*/${L_COLORPALETTE}/" "${CONFFILE}" + else + echo "${L_COLORPALETTE}" >> "${CONFFILE}" + fi + + if grep -q "^ColorCursor=" "${CONFFILE}"; then + sed -i -r -e "s/^ColorCursor=.*/${L_COLORCURSOR}/" "${CONFFILE}" + else + echo "${L_COLORCURSOR}" >> "${CONFFILE}" + fi + + 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 -q "^ColorBackground=" "${CONFFILE}"; then + sed -i -r -e "s/^ColorBackground=.*/ColorBackground=${BACKGROUND_COLOR}/" "${CONFFILE}" + else + echo "ColorBackground=${BACKGROUND_COLOR}" >> "${CONFFILE}" + fi + + if grep -q "^ColorCursorUseDefault=FALSE" "${CONFFILE}"; then + true + else + echo "ColorCursorUseDefault=FALSE" >> "${CONFFILE}" + fi + fi + fi + + unset SCHEMEDIR + unset CONFFILE + unset PROFILE_NAME + unset F_NAME + unset FF_NAME + unset L_COLORCURSOR + unset L_COLORPALETTE + exit 0 +} [[ -n "${UUIDGEN}" ]] && PROFILE_SLUG="$(uuidgen)" @@ -603,6 +685,10 @@ case "${TERMINAL}" in apply_gtk ;; + xfce4-terminal ) + apply_xfce4-terminal + ;; + * ) printf '%s\n' \ "Unsupported terminal!" \ @@ -615,6 +701,7 @@ case "${TERMINAL}" in " mate-terminal" \ " gnome-terminal" \ " tilix" \ + " xfce4-terminal" \ "" \ "If you believe you have recieved this message in error," \ "try manually setting \`TERMINAL', hint: ps -h -o comm -p \$PPID"