From f57f634101496e9c9a5ac4af0d8eea25a36174df Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Wed, 21 Aug 2019 23:18:05 +1200 Subject: [PATCH 1/4] Add colorcli and relaxed themes --- apply-colors.sh | 8 ++++++++ gogh.sh | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/apply-colors.sh b/apply-colors.sh index 1dfc0e0..c042345 100644 --- a/apply-colors.sh +++ b/apply-colors.sh @@ -33,6 +33,8 @@ GLOBAL_VAR_CLEANUP() { unset BACKGROUND_COLOR unset FOREGROUND_COLOR unset CURSOR_COLOR + unset HIGHLIGHT_FG_COLOR + unset HIGHLIGHT_BG_COLOR unset PROFILE_NAME } @@ -235,6 +237,12 @@ set_theme() { dset background-color "'${BACKGROUND_COLOR}'" dset foreground-color "'${FOREGROUND_COLOR}'" + if [[ -n "${HIGHLIGHT_BG_COLOR:-}" ]]; then + dset highlight-colors-set "true" + dset highlight-background-color "${HIGHLIGHT_BG_COLOR}" + dset highlight-foreground-color "${HIGHLIGHT_FG_COLOR:-$FOREGROUND_COLOR}" + fi + if [[ -n "${BOLD_COLOR:-}" ]]; then dset bold-color "'${BOLD_COLOR}'" dset bold-color-same-as-fg "false" diff --git a/gogh.sh b/gogh.sh index e22996e..b0b7071 100755 --- a/gogh.sh +++ b/gogh.sh @@ -11,6 +11,8 @@ GLOBAL_VAR_CLEANUP(){ trap 'GLOBAL_VAR_CLEANUP; trap - EXIT' EXIT HUP INT QUIT PIPE TERM +# TO-DO: Investigate dynamically building this array e.g. +# curl -s https://github.com/Mayccoll/Gogh/tree/master/themes | grep -o "title=.*\.sh\" " | awk -F '=' '{print $2}' declare -a THEMES=( '3024-day.sh' '3024-night.sh' @@ -40,6 +42,7 @@ declare -a THEMES=( 'clrs.sh' 'cobalt2.sh' 'cobalt-neon.sh' + 'colorcli.sh' 'crayon-pony-fish.sh' 'dark-pastel.sh' 'darkside.sh' @@ -141,6 +144,7 @@ declare -a THEMES=( 'pro.sh' 'red-alert.sh' 'red-sands.sh' + 'relaxed.sh' 'rippedcasts.sh' 'royal.sh' 'sat.sh' From 3d20359d6ca939b3e961027a319f013e9e48c1b0 Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Wed, 21 Aug 2019 23:23:18 +1200 Subject: [PATCH 2/4] Add text highlight functionality (testing), colorcli and relaxed themes --- themes/colorcli.sh | 53 ++++++++++++++++++++++++++++++++++++++++++++++ themes/relaxed.sh | 51 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 104 insertions(+) create mode 100644 themes/colorcli.sh create mode 100644 themes/relaxed.sh diff --git a/themes/colorcli.sh b/themes/colorcli.sh new file mode 100644 index 0000000..b969d15 --- /dev/null +++ b/themes/colorcli.sh @@ -0,0 +1,53 @@ +#!/usr/bin/env bash +# colorcli theme from https://github.com/jonasjacek/colorcli + +# ====================CONFIG THIS =============================== # +export COLOR_01="#000000" # HOST (black - system) +export COLOR_02="#D70000" # SYNTAX_STRING (red3) +export COLOR_03="#5FAF00" # COMMAND (Chartreuse3) +export COLOR_04="#FFFF00" # COMMAND_COLOR2 (yellow1) +export COLOR_05="#005F87" # PATH (deepskyblue4) +export COLOR_06="#D70000" # SYNTAX_VAR (red3) +export COLOR_07="#5F5F5F" # PROMPT (gray37) +export COLOR_08="#E4E4E4" # (gray89) + +export COLOR_09="#5F5F5F" # Dark gray (gray37) +export COLOR_10="#D70000" # COMMAND_ERROR (red3) +export COLOR_11="#FF8700" # EXEC (DarkOrange) +export COLOR_12="#FFFF00" # Light Yellow (yellow1) +export COLOR_13="#0087AF" # Light Blue (deepskyblue3) +export COLOR_14="#0087AF" # Light Magenta (deepskyblue3) +export COLOR_15="#0087AF" # Light Cyan (deepskyblue3) +export COLOR_16="#FFFFFF" # White (white - system) + +export BACKGROUND_COLOR="#FFFFFF" # Background Color +export FOREGROUND_COLOR="#5F5F5F" # Foreground Color (text - gray37) +export CURSOR_COLOR="$FOREGROUND_COLOR" # Cursor color +export HIGHLIGHT_FG_COLOR="$FOREGROUND_COLOR" # Text color within highlight +export HIGHLIGHT_BG_COLOR="#BCBCBC" # Highlight color (gray74) +export PROFILE_NAME="colorcli" +# =============================================================== # + + +# =============================================================== # +# | Apply Colors +# ===============================================================|# +SCRIPT_PATH="${SCRIPT_PATH:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" +PARENT_PATH="$(dirname "${SCRIPT_PATH}")" + +# Allow developer to change url to forked url for easier testing +# IMPORTANT: Make sure you export this variable if your main shell is not bash +BASE_URL=${BASE_URL:-"https://raw.githubusercontent.com/Mayccoll/Gogh/master"} + + +if [[ -e "${PARENT_PATH}/apply-colors.sh" ]]; then + bash "${PARENT_PATH}/apply-colors.sh" +else + if [[ "$(uname)" = "Darwin" ]]; then + # OSX ships with curl and ancient bash + bash -c "$(curl -so- "${BASE_URL}/apply-colors.sh")" + else + # Linux ships with wget + bash -c "$(wget -qO- "${BASE_URL}/apply-colors.sh")" + fi +fi diff --git a/themes/relaxed.sh b/themes/relaxed.sh new file mode 100644 index 0000000..bc89a0f --- /dev/null +++ b/themes/relaxed.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# Relaxed theme from https://github.com/Relaxed-Theme + +# ====================CONFIG THIS =============================== # +export COLOR_01="#151515" # HOST +export COLOR_02="#BC5653" # SYNTAX_STRING +export COLOR_03="#909D63" # COMMAND +export COLOR_04="#EBC17A" # COMMAND_COLOR2 +export COLOR_05="#6A8799" # PATH +export COLOR_06="#B06698" # SYNTAX_VAR +export COLOR_07="#C9DFFF" # PROMPT +export COLOR_08="#D9D9D9" # + +export COLOR_09="#636363" # Dark gray +export COLOR_10="#BC5653" # COMMAND_ERROR +export COLOR_11="#A0AC77" # EXEC +export COLOR_12="#EBC17A" # Light Yellow +export COLOR_13="#7EAAC7" # Light Blue +export COLOR_14="#B06698" # Light Magenta +export COLOR_15="#ACBBD0" # Light Cyan +export COLOR_16="#F7F7F7" # White + +export BACKGROUND_COLOR="#353A44" # Background Color +export FOREGROUND_COLOR="#D9D9D9" # Foreground Color +export CURSOR_COLOR="$FOREGROUND_COLOR" # Cursor color +export HIGHLIGHT_FG_COLOR="$FOREGROUND_COLOR" # Text color within highlight +export HIGHLIGHT_BG_COLOR="#ACBBD0" # Highlight color +export PROFILE_NAME="relaxed" +# =============================================================== # + + +# =============================================================== # +# | Apply Colors +# ===============================================================|# +SCRIPT_PATH="${SCRIPT_PATH:-$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)}" +PARENT_PATH="$(dirname "${SCRIPT_PATH}")" + +# Allow developer to change url to forked url for easier testing +# IMPORTANT: Make sure you export this variable if your main shell is not bash +BASE_URL=${BASE_URL:-"https://raw.githubusercontent.com/Mayccoll/Gogh/master"} + + +if [[ -e "${PARENT_PATH}/apply-colors.sh" ]]; then + bash "${PARENT_PATH}/apply-colors.sh" +else + if command -v curl >/dev/null 2>&1; then + bash -c "$(curl -so- "${BASE_URL}/apply-colors.sh")" + elif command -v wget >/dev/null 2>&1; then + bash -c "$(wget -qO- "${BASE_URL}/apply-colors.sh")" + fi +fi From f8538c3f19e6f1fe0578084041e137ce2b866da3 Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Thu, 22 Aug 2019 00:12:12 +1200 Subject: [PATCH 3/4] Testing and improvements for colorcli and relaxed themes. Add transparency handling --- apply-colors.sh | 9 +++++++-- themes/colorcli.sh | 18 +++++++++--------- themes/relaxed.sh | 4 ++-- 3 files changed, 18 insertions(+), 13 deletions(-) mode change 100644 => 100755 themes/colorcli.sh mode change 100644 => 100755 themes/relaxed.sh diff --git a/apply-colors.sh b/apply-colors.sh index c042345..a8b2e31 100644 --- a/apply-colors.sh +++ b/apply-colors.sh @@ -239,8 +239,10 @@ set_theme() { if [[ -n "${HIGHLIGHT_BG_COLOR:-}" ]]; then dset highlight-colors-set "true" - dset highlight-background-color "${HIGHLIGHT_BG_COLOR}" - dset highlight-foreground-color "${HIGHLIGHT_FG_COLOR:-$FOREGROUND_COLOR}" + dset highlight-background-color "'${HIGHLIGHT_BG_COLOR}'" + if [[ -n "${HIGHLIGHT_FG_COLOR:-}" ]]; then + dset highlight-foreground-color "'${HIGHLIGHT_FG_COLOR}'" + fi fi if [[ -n "${BOLD_COLOR:-}" ]]; then @@ -252,6 +254,7 @@ set_theme() { fi dset use-theme-colors "false" dset use-theme-background "false" + dset use-theme-transparency "${USE_SYS_TRANSPARENCY:-false}" } legacy_set_theme() { @@ -439,6 +442,8 @@ apply_gtk() { BACKGROUND_COLOR=$(gnome_color "$BACKGROUND_COLOR") FOREGROUND_COLOR=$(gnome_color "$FOREGROUND_COLOR") + HIGHLIGHT_BG_COLOR=$(gnome_color "$HIGHLIGHT_BG_COLOR") + HIGHLIGHT_FG_COLOR=$(gnome_color "$HIGHLIGHT_FG_COLOR") COLOR_01=$(gnome_color "$COLOR_01") COLOR_02=$(gnome_color "$COLOR_02") COLOR_03=$(gnome_color "$COLOR_03") diff --git a/themes/colorcli.sh b/themes/colorcli.sh old mode 100644 new mode 100755 index b969d15..b867f1f --- a/themes/colorcli.sh +++ b/themes/colorcli.sh @@ -5,7 +5,7 @@ export COLOR_01="#000000" # HOST (black - system) export COLOR_02="#D70000" # SYNTAX_STRING (red3) export COLOR_03="#5FAF00" # COMMAND (Chartreuse3) -export COLOR_04="#FFFF00" # COMMAND_COLOR2 (yellow1) +export COLOR_04="#5FAF00" # COMMAND_COLOR2 (Chartreuse3) export COLOR_05="#005F87" # PATH (deepskyblue4) export COLOR_06="#D70000" # SYNTAX_VAR (red3) export COLOR_07="#5F5F5F" # PROMPT (gray37) @@ -13,7 +13,7 @@ export COLOR_08="#E4E4E4" # (gray89) export COLOR_09="#5F5F5F" # Dark gray (gray37) export COLOR_10="#D70000" # COMMAND_ERROR (red3) -export COLOR_11="#FF8700" # EXEC (DarkOrange) +export COLOR_11="#5F5F5F" # EXEC (gray37) export COLOR_12="#FFFF00" # Light Yellow (yellow1) export COLOR_13="#0087AF" # Light Blue (deepskyblue3) export COLOR_14="#0087AF" # Light Magenta (deepskyblue3) @@ -21,11 +21,12 @@ export COLOR_15="#0087AF" # Light Cyan (deepskyblue3) export COLOR_16="#FFFFFF" # White (white - system) export BACKGROUND_COLOR="#FFFFFF" # Background Color -export FOREGROUND_COLOR="#5F5F5F" # Foreground Color (text - gray37) +export FOREGROUND_COLOR="#005F87" # Foreground Color (text - deepskyblue4) export CURSOR_COLOR="$FOREGROUND_COLOR" # Cursor color -export HIGHLIGHT_FG_COLOR="$FOREGROUND_COLOR" # Text color within highlight +export HIGHLIGHT_FG_COLOR="#0087AF" # Text color within highlight (deepskyblue3) export HIGHLIGHT_BG_COLOR="#BCBCBC" # Highlight color (gray74) -export PROFILE_NAME="colorcli" +export USE_SYS_TRANSPARENCY="false" +export PROFILE_NAME="Colorcli" # =============================================================== # @@ -43,11 +44,10 @@ BASE_URL=${BASE_URL:-"https://raw.githubusercontent.com/Mayccoll/Gogh/master"} if [[ -e "${PARENT_PATH}/apply-colors.sh" ]]; then bash "${PARENT_PATH}/apply-colors.sh" else - if [[ "$(uname)" = "Darwin" ]]; then - # OSX ships with curl and ancient bash + if command -v curl >/dev/null 2>&1; then bash -c "$(curl -so- "${BASE_URL}/apply-colors.sh")" - else - # Linux ships with wget + elif command -v wget >/dev/null 2>&1; then bash -c "$(wget -qO- "${BASE_URL}/apply-colors.sh")" fi fi + diff --git a/themes/relaxed.sh b/themes/relaxed.sh old mode 100644 new mode 100755 index bc89a0f..c23c31c --- a/themes/relaxed.sh +++ b/themes/relaxed.sh @@ -24,8 +24,8 @@ export BACKGROUND_COLOR="#353A44" # Background Color export FOREGROUND_COLOR="#D9D9D9" # Foreground Color export CURSOR_COLOR="$FOREGROUND_COLOR" # Cursor color export HIGHLIGHT_FG_COLOR="$FOREGROUND_COLOR" # Text color within highlight -export HIGHLIGHT_BG_COLOR="#ACBBD0" # Highlight color -export PROFILE_NAME="relaxed" +export HIGHLIGHT_BG_COLOR="#6A8799" # Highlight color +export PROFILE_NAME="Relaxed" # =============================================================== # From d7ac43eb3c4e175219290d0f0a885e52e5aead7e Mon Sep 17 00:00:00 2001 From: Rawiri Blundell Date: Thu, 22 Aug 2019 00:17:50 +1200 Subject: [PATCH 4/4] Ensure that apply-colors.sh is unsetting the USE_SYS_TRANSPARENCY variable --- apply-colors.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/apply-colors.sh b/apply-colors.sh index a8b2e31..98d1db2 100644 --- a/apply-colors.sh +++ b/apply-colors.sh @@ -35,6 +35,7 @@ GLOBAL_VAR_CLEANUP() { unset CURSOR_COLOR unset HIGHLIGHT_FG_COLOR unset HIGHLIGHT_BG_COLOR + unset USE_SYS_TRANSPARENCY unset PROFILE_NAME }