From d0cfe58dd2b139e34cf0dd2c5177d81631176da3 Mon Sep 17 00:00:00 2001 From: yage Date: Tue, 23 Apr 2024 15:04:29 -0600 Subject: [PATCH] colorscheme fixes --- scwrypts/dotwryn/desktop/colorscheme/get-theme | 14 ++++++++++++++ .../lib/desktop/colorscheme/alacritty.module.zsh | 8 ++++++++ .../lib/desktop/colorscheme/colorscheme.module.zsh | 3 ++- .../lib/desktop/colorscheme/polybar.module.zsh | 3 ++- .../lib/desktop/colorscheme/rofi.module.zsh | 5 +++-- 5 files changed, 29 insertions(+), 4 deletions(-) create mode 100755 scwrypts/dotwryn/desktop/colorscheme/get-theme diff --git a/scwrypts/dotwryn/desktop/colorscheme/get-theme b/scwrypts/dotwryn/desktop/colorscheme/get-theme new file mode 100755 index 0000000..829f76f --- /dev/null +++ b/scwrypts/dotwryn/desktop/colorscheme/get-theme @@ -0,0 +1,14 @@ +#!/bin/zsh +use desktop/colorscheme --group dotwryn +##################################################################### + +USAGE__description+=' + output the name of the current system theme +' + +##################################################################### + +MAIN() { + cat "$ACTIVE_THEME_PATH/name.txt" 2>/dev/null \ + || ERROR 'theme name not available' +} diff --git a/scwrypts/dotwryn/lib/desktop/colorscheme/alacritty.module.zsh b/scwrypts/dotwryn/lib/desktop/colorscheme/alacritty.module.zsh index 4c54975..926d0a0 100644 --- a/scwrypts/dotwryn/lib/desktop/colorscheme/alacritty.module.zsh +++ b/scwrypts/dotwryn/lib/desktop/colorscheme/alacritty.module.zsh @@ -61,6 +61,14 @@ colors: cyan: '0x$BRIGHT_CYAN' white: '0x$BRIGHT_WHITE' " | sed '$d' > "$_COLORSCHEME_FILE__alacritty_yaml" + + local TRANSPARENCY_OVERRIDE=$(cat "$SOURCE_THEME" | YQ -r '.alacritty.transparency' | grep -v '^null$') + [ $TRANSPARENCY_OVERRIDE ] && { + printf "[window]\nopacity = $TRANSPARENCY_OVERRIDE\n" >> "$_COLORSCHEME_FILE__alacritty_toml" + printf "window:\n opacity: 0.8" >> "$_COLORSCHEME_FILE__alacritty_yaml" + } + + return 0 } _SET_THEME__alacritty() { diff --git a/scwrypts/dotwryn/lib/desktop/colorscheme/colorscheme.module.zsh b/scwrypts/dotwryn/lib/desktop/colorscheme/colorscheme.module.zsh index 50e311b..2dcf383 100644 --- a/scwrypts/dotwryn/lib/desktop/colorscheme/colorscheme.module.zsh +++ b/scwrypts/dotwryn/lib/desktop/colorscheme/colorscheme.module.zsh @@ -226,7 +226,8 @@ SET_THEME() { } done - CHECK_ERRORS --no-usage + CHECK_ERRORS --no-usage \ + && echo "$THEME_NAME" > "$ACTIVE_THEME_PATH/name.txt" } ##################################################################### diff --git a/scwrypts/dotwryn/lib/desktop/colorscheme/polybar.module.zsh b/scwrypts/dotwryn/lib/desktop/colorscheme/polybar.module.zsh index 8c5a8b8..6267b4b 100644 --- a/scwrypts/dotwryn/lib/desktop/colorscheme/polybar.module.zsh +++ b/scwrypts/dotwryn/lib/desktop/colorscheme/polybar.module.zsh @@ -5,8 +5,9 @@ _GENERATE_THEME__polybar() { # theme : $THEME_NAME [colors] background = #$(_GET_HEX .polybar.background .background) -background-alt = #$(_GET_HEX .polybar.background-alt .selection.background) foreground = #$(_GET_HEX .polybar.foreground .foreground) +background-alt = #$(_GET_HEX .polybar.background-alt .selection.background) +foreground-alt = #$(_GET_HEX .polybar.foreground-alt .selection.foreground) primary = #$(_GET_HEX .polybar.primary .material.base.primary .ansi.green.regular) secondary = #$(_GET_HEX .polybar.secondary .material.base.secondary .ansi.blue.regular) alert = #$(_GET_HEX .polybar.alert .material.base.error .ansi.red.regular) diff --git a/scwrypts/dotwryn/lib/desktop/colorscheme/rofi.module.zsh b/scwrypts/dotwryn/lib/desktop/colorscheme/rofi.module.zsh index 83cc30a..a269d6c 100644 --- a/scwrypts/dotwryn/lib/desktop/colorscheme/rofi.module.zsh +++ b/scwrypts/dotwryn/lib/desktop/colorscheme/rofi.module.zsh @@ -7,9 +7,10 @@ _GENERATE_THEME__rofi() { **/ *{ - background: #$(_GET_HEX .rofi.background .background); - foreground: #$(_GET_HEX .rofi.foreground .foreground); + background: #$(_GET_HEX .rofi.background .material.secondary.900 .background); + foreground: #$(_GET_HEX .rofi.foreground .material.foreground.secondary.900 .foreground); background-alt: #$(_GET_HEX .rofi.background-alt .material.primary.300 .selection.background); + foreground-alt: #$(_GET_HEX .rofi.foreground-alt .material.foreground.primary.300 .selection.foreground); selected: #$(_GET_HEX .rofi.selected .material.foreground.primary.300 .selection.foreground); active: #$(_GET_HEX .rofi.active .material.base.primary .ansi.green.regular); urgent: #$(_GET_HEX .rofi.urgent .material.base.error .ansi.red.regular );