From d4fd63c54b41285d6b76fc0714860e187400a06b Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Thu, 3 Aug 2023 01:28:41 +0200 Subject: [PATCH] OB title font color only black and white --- bin/obtctl | 24 +++++++++++++++--------- bin/w2theme | 20 ++++++++++++-------- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/bin/obtctl b/bin/obtctl index a173fb2..e0c7a39 100755 --- a/bin/obtctl +++ b/bin/obtctl @@ -190,9 +190,9 @@ activegradient () { # calculate color for title.fg and buttons TITLE_FG=$(pastel textcolor ${2}|pastel format hex) if [[ "${TITLE_FG}" == *"ffffff"* ]];then - TITLE_FG="#EEEEEE" + TITLE_FG="#E5E5E5" else - TITLE_FG="#111111" + TITLE_FG="#222222" fi sd "\.active.label.text.color:.*$" ".active.label.text.color: ${TITLE_FG}" ${THEMERC} @@ -201,7 +201,7 @@ activegradient () { # Shadow read SHADOW <<< "$(grep .active.label.text.font: ${THEMERC} | cut -d':' -f2| cut -d'=' -f2)" if [ "$SHADOW" == "y" ];then - if [ "$TITLE_FG" == "#EEEEEE" ];then + if [ "$TITLE_FG" == "#E5E5E5" ];then shadow dark else shadow light @@ -254,9 +254,9 @@ clractivebg_only () { # calculate color for title.fg and buttons TITLE_FG=$(pastel textcolor ${1}|pastel format hex) if [[ "${TITLE_FG}" == *"ffffff"* ]];then - TITLE_FG="#EEEEEE" + TITLE_FG="#E5E5E5" else - TITLE_FG="#111111" + TITLE_FG="#222222" fi sd "\.active.label.text.color:.*$" ".active.label.text.color: ${TITLE_FG}" ${THEMERC} @@ -288,9 +288,9 @@ clractivebg () { # calculate color for title.fg and buttons TITLE_FG=$(pastel textcolor ${colorTo}|pastel format hex) if [[ "${TITLE_FG}" == *"ffffff"* ]];then - TITLE_FG="#EEEEEE" + TITLE_FG="#E5E5E5" else - TITLE_FG="#111111" + TITLE_FG="#222222" fi sd "\.active.label.text.color:.*$" ".active.label.text.color: ${TITLE_FG}" ${THEMERC} @@ -379,10 +379,16 @@ ndslimc() { activebuttonscolors () { sd "^window.active.button.*.unpressed.image.color:.*$" "window.active.button.*.unpressed.image.color: ${1}" ${THEMERC} # Calculate colors for other button states (mix of ${1} and clractivebg - read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)" - hover=$(pastel mix -f 0.2 "${1}" "${ABG}"|pastel format hex) + #read ABG <<< "$(grep .active.title.bg.color: ${THEMERC} | cut -d':' -f2)" + #hover=$(pastel mix -f 0.2 "${1}" "${ABG}"|pastel format hex) #pressed=$() #disabled=$() + if [[ "${1}" == *"E5E5E5"* ]];then + hover="#FFFFFF" + else + hover="#000000" + fi + #notify-send.sh "${1}" "${hover}" sd "^window.active.button.*.hover.image.color:.*$" "window.active.button.*.hover.image.color: ${hover}" ${THEMERC} } fontfamily () { diff --git a/bin/w2theme b/bin/w2theme index a9d1dd2..7c9ab62 100755 --- a/bin/w2theme +++ b/bin/w2theme @@ -256,11 +256,13 @@ case "$1" in obtctl clractivebg ${w[2]} TITLE_FG=$(pastel textcolor ${w[2]}|pastel format hex) if [[ "$TITLE_FG" == *"ffffff"* ]];then - obtctl activetextcolor ${w[-1]} - obtctl activebuttonscolors ${w[-1]} + obtctl activetextcolor "#E5E5E5" + #obtctl activetextcolor ${w[-1]} + #obtctl activebuttonscolors ${w[-1]} else - obtctl activetextcolor ${w[0]} - obtctl activebuttonscolors ${w[0]} + obtctl activetextcolor "#222222" + #obtctl activetextcolor ${w[0]} + #obtctl activebuttonscolors ${w[0]} fi obtctl clractivebgto ${w[4]} obtctl clrnormalbg ${w[0]} @@ -270,11 +272,13 @@ case "$1" in obtctl clractivebg ${w[-2]} TITLE_FG=$(pastel textcolor ${w[-2]}|pastel format hex) if [[ "$TITLE_FG" == *"ffffff"* ]];then - obtctl activetextcolor ${w[-1]} - obtctl activebuttonscolors ${w[-1]} + obtctl activetextcolor "#E5E5E5" + #obtctl activetextcolor ${w[-1]} + #obtctl activebuttonscolors ${w[-1]} else - obtctl activetextcolor ${w[0]} - obtctl activebuttonscolors ${w[0]} + obtctl activetextcolor "#222222" + #obtctl activetextcolor ${w[0]} + #obtctl activebuttonscolors ${w[0]} fi obtctl clractivebgto ${w[-4]} obtctl clrnormalbg ${w[1]}