From ef0d17854bbc616539284988c286e7a3e26c18f1 Mon Sep 17 00:00:00 2001 From: Ivan Toshkov Date: Mon, 30 May 2022 14:19:42 +0300 Subject: [PATCH 1/2] Make elementary OS terminal transparent The elementary OS/Pantheon terminal uses a 5% transparent background. This change applies this transparency for the Gogh themes. --- apply-colors.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/apply-colors.sh b/apply-colors.sh index 7881da9..d2a4eeb 100755 --- a/apply-colors.sh +++ b/apply-colors.sh @@ -385,7 +385,19 @@ apply_elementary() { # | # | Applying values on elementary/pantheon terminal # | =========================================== - gset background "${BACKGROUND_COLOR}" + + local BG_COLOR="${BACKGROUND_COLOR}" + + # If the background color is in the format #rrggbb, convert it to rgba(r,g,b,0.95). + # This makes it 5% transparent, which is the default in elementary OS. + if [[ ${BACKGROUND_COLOR} =~ ^#[0-9A-Fa-f]{6}$ ]]; then + local R="$((16#${BACKGROUND_COLOR:1:2}))" + local G="$((16#${BACKGROUND_COLOR:3:2}))" + local B="$((16#${BACKGROUND_COLOR:5:2}))" + BG_COLOR="rgba($R,$G,$B,0.95)" + fi + + gset background "${BG_COLOR}" gset foreground "${FOREGROUND_COLOR}" gset cursor-color "${CURSOR_COLOR}" gset palette "${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}" From aac975cdceb09f57a403d9f8fce0744935406cc1 Mon Sep 17 00:00:00 2001 From: Ivan Toshkov Date: Mon, 30 May 2022 14:53:48 +0300 Subject: [PATCH 2/2] Use the :xdigit: character class --- apply-colors.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apply-colors.sh b/apply-colors.sh index d2a4eeb..1c68e3c 100755 --- a/apply-colors.sh +++ b/apply-colors.sh @@ -390,7 +390,7 @@ apply_elementary() { # If the background color is in the format #rrggbb, convert it to rgba(r,g,b,0.95). # This makes it 5% transparent, which is the default in elementary OS. - if [[ ${BACKGROUND_COLOR} =~ ^#[0-9A-Fa-f]{6}$ ]]; then + if [[ ${BACKGROUND_COLOR} =~ ^#[[:xdigit:]]{6}$ ]]; then local R="$((16#${BACKGROUND_COLOR:1:2}))" local G="$((16#${BACKGROUND_COLOR:3:2}))" local B="$((16#${BACKGROUND_COLOR:5:2}))"