From 106b6909d95b9bc637ff21d7d1cd275078a357fe Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Mon, 11 Sep 2023 18:59:49 +0200 Subject: [PATCH] Conky and mbclr improvements --- bin/colorizer-conky | 29 ++++--- bin/colorizer-menus | 12 ++- bin/conkyctl | 85 ++++++++++++++++---- bin/mbclr | 24 +++--- share/mabox-colorizer/colorschemes/conky.csv | 22 ++--- 5 files changed, 114 insertions(+), 58 deletions(-) diff --git a/bin/colorizer-conky b/bin/colorizer-conky index 6c8d475..f66a6fe 100755 --- a/bin/colorizer-conky +++ b/bin/colorizer-conky @@ -17,7 +17,7 @@ # along with this program. If not, see . SYSSCHEMES="/usr/share/mabox-colorizer/colorschemes/conky.csv" -USERSCHEMES="$HOME/.config/colorizer/conky/userschemes.csv" +USERSCHEMES="$HOME/.config/colorizer/conky/c_userschemes.csv" me="colorizer-conky -s" @@ -205,7 +205,8 @@ getvalues () { read BORD <<< "$(grep draw_borders ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)" read STIP <<< "$(grep stippled_borders ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)" - currcolors="${WINCLR}|${CLR}|${CLR0}|${CLR1}|${CLR2}|" + #currcolors="${WINCLR}|${CLR}|${CLR0}|${CLR1}|${CLR2}|" + cursettings="${WINCLR}|${CLR}|${CLR0}|${CLR1}|${CLR2}|${WINTRANS}|${OUTLINE}|${SHADES}|${BORD}|${STIP}|" } if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then @@ -213,7 +214,7 @@ if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then getvalues if [ ! -f "$USERSCHEMES" ]; then mkdir -p "$HOME/.config/colorizer/conky/" - echo "WINCLR | CLR | CLR0 | CLR1 | CLR2 |scheme_name" > "$USERSCHEMES" + echo "WINCLR | CLR | CLR0 | CLR1 | CLR2 |WINTRANS|OUTLINE|SHADES | BORD | STIP |scheme_name" > "$USERSCHEMES" fi @@ -314,33 +315,34 @@ if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then out+=("^sep($GLOBALSETTINGS)") out+=(" $MOVEABLEALL,conkyctl makemoveableall") out+=("^sep()") - out+=(" $REGENERATE,^checkout(regenconky)") + [[ "$WINTRANS" = true ]] && bga=1 || bga=100 + out+=(" $REGENERATE,^checkout(regenconky)") out2+=("^tag(regenconky)") out2+=("^sep($REGENERATE)") out2+=("^sep($SYSTEM_SCHEMES)") n=1 - while IFS="|" read -r winclr clr clr0 clr1 clr2 scheme_name + while IFS="|" read -r winclr clr clr0 clr1 clr2 wintrans outline shades bord stip scheme_name do ((n=n+1)) - - out2+=("$(printf '%-20s' "${scheme_name}") 󰯲 󰝥 󰲠 󰲢 ,conkyctl applyscheme_all sys ${n};$me") + [[ "$wintrans" = true ]] && bga=1 || bga=100 + out2+=("$(printf '%-20s' "${scheme_name}") 󰯲 󰝥 󰲠 󰲢 ,conkyctl applyscheme_all sys ${n};$me") done < <(tail -n +2 "$SYSSCHEMES") out2+=("^sep($YOUR_SCHEMES)") - out2+=(" $SAVE_CURRSCHEME,conkyctl savescheme '${currcolors}';$me") + out2+=(" $SAVE_CURRSCHEME,conkyctl savescheme '${cursettings}';$me") out2+=(" $OPEN_SCHEMEFILE,xdg-open $USERSCHEMES") out2+=("^sep()") n=1 - while IFS="|" read -r winclr clr clr0 clr1 clr2 scheme_name + while IFS="|" read -r winclr clr clr0 clr1 clr2 wintrans outline shades bord stip scheme_name do ((n=n+1)) - - out2+=("$(printf '%-20s' "${scheme_name}") 󰯲 󰝥 󰲠 󰲢 ,^checkout(sch${n})") + [[ "$wintrans" = true ]] && bga=1 || bga=100 + out2+=("$(printf '%-20s' "${scheme_name}") 󰯲 󰝥 󰲠 󰲢 ,^checkout(sch${n})") #echo "${own_window_colour}|${default_color}|${color0}|${color1}|${color2}|${themename}" >> "$USERSCHEMES" out3+=("^tag(sch${n}") out3+=("^sep($COLORSCHEME: ${scheme_name})") - out3+=(" $APPLY_SCHEME 󰯲 󰝥 󰲠 󰲢 ,conkyctl applyscheme_all usr ${n};$me") + out3+=(" $APPLY_SCHEME 󰯲 󰝥 󰲠 󰲢 ,conkyctl applyscheme_all usr ${n};$me") out3+=("^sep($DELETE)") out3+=("󰗨 $DELETE_SCHEME ${scheme_name},conkyctl delscheme ${n};$me") done < <(tail -n +2 "$USERSCHEMES") @@ -402,7 +404,8 @@ if pgrep -u $USER -af "conky.*mbcolor" >/dev/null; then [[ "$STIP" == 3 ]] && out2+=(" 3 px,conkyctl stippled_borders_all 3;$me") || out2+=(" 3 px,conkyctl stippled_borders_all 3;$me") [[ "$STIP" == 4 ]] && out2+=(" 4 px,conkyctl stippled_borders_all 4;$me") || out2+=(" 4 px,conkyctl stippled_borders_all 4;$me") - out+=("^sep()") + out+=("^sep()") + pgrep -af "conky/sysinfo_mbcolor" > /dev/null || out+=("  README (important info),conkyctl baseconky_info") if [ "$WINTRANS" == false ];then out+=(" AbCd $BACKGROUND,^pipe(mbclr '$WINCLR' conkyctl win_bgcolor_all '${BACKGROUND}' '$me')") else diff --git a/bin/colorizer-menus b/bin/colorizer-menus index 6e89819..f333907 100755 --- a/bin/colorizer-menus +++ b/bin/colorizer-menus @@ -67,6 +67,7 @@ case "$LANG" in pl*) MENU_THEME="Motyw menu" QUICK_TWEAKS="Ustawienia główne" + OVERALL_STYLE="Ogólny styl" SCHEMES="Motywy kolorystycznie" SYSTEM_SCHEMES="Systemowe" YOUR_SCHEMES="Moje motywy" @@ -148,6 +149,7 @@ case "$LANG" in *) MENU_THEME="Menu theme" QUICK_TWEAKS="Global Settings/Quick Tweaks" + OVERALL_STYLE="Overall style" SCHEMES="Color Schemes" SYSTEM_SCHEMES="System colorschemes" YOUR_SCHEMES="My colorschemes" @@ -264,7 +266,7 @@ out+=("^sep($MENU_THEME: ${jgmenu_theme})") out+=("$QUICK_TWEAKS,^checkout(tweaks)") out2+=("^tag(tweaks)") - out2+=("^sep(Overall style)") + out2+=("^sep($OVERALL_STYLE)") ###### out2+=("$BORDER [ ${jgtools_border:-0}px ],^checkout(mborder)") out2+=("$PADDING [ ${jgtools_padding:-0}px ],^checkout(mpadding)") @@ -550,14 +552,10 @@ out2+=("^sep()") [[ "$IRADIUS" == 6 ]] && out2+=(" 6 px,jgctl item_radius 6;$me") || out2+=(" 6 px,jgctl item_radius 6;$me") -out+=("^sep($MORE_MENU_SETTINGS)") -out+=(" $GLOBAL_MENU_SETTINGS,jgmenusettings-pipe -c") +#out+=("^sep($MORE_MENU_SETTINGS)") +#out+=(" $GLOBAL_MENU_SETTINGS,jgmenusettings-pipe -c") #out+=("$GLOBAL_MENU_SETTINGS,^pipe(jgmenusettings-pipe -r)") - -### We don't need many menu themes anymore -#out+=(" $SET_RANDOM,mb-setvar jgmenu_theme=$(basename -s .colorrc $(ls ~/.config/mabox/jgobthemes/*.colorrc | shuf -n 1));$me") - ### RUN if [[ "$1" == "-s" ]]; then . /usr/share/mb-jgtools/pipemenu-standalone.cfg diff --git a/bin/conkyctl b/bin/conkyctl index ab5dd43..3c0391f 100755 --- a/bin/conkyctl +++ b/bin/conkyctl @@ -575,10 +575,10 @@ single () { unset NOT_SUPPORTED OLD_SYNTAX SYSSCHEMES="/usr/share/mabox-colorizer/colorschemes/conky.csv" - USERSCHEMES="$HOME/.config/colorizer/conky/userschemes.csv" + USERSCHEMES="$HOME/.config/colorizer/conky/c_userschemes.csv" if [ ! -f "$USERSCHEMES" ]; then mkdir -p "$HOME/.config/colorizer/conky/" - echo "WINCLR | CLR | CLR0 | CLR1 | CLR2 |scheme_name" > "$USERSCHEMES" + echo "WINCLR | CLR | CLR0 | CLR1 | CLR2 |WINTRANS|OUTLINE|SHADES | BORD | STIP |scheme_name" > "$USERSCHEMES" fi ### Wallpaper colors @@ -738,28 +738,31 @@ if [[ "$OLD_SYNTAX" = "true" ]];then out+=("^sep($COLORS)") # COLOR SCHEMES - if [ "$WINTRANS" == false ];then + #if [ "$WINTRANS" == false ];then out+=(" $COLORSCHEME,^checkout(regensingle)") out2+=("^tag(regensingle)") out2+=("^sep($APPLY_THEME)") out2+=("^sep($SYSTEM_SCHEMES)") n=1 - while IFS="|" read -r winclr clr clr0 clr1 clr2 scheme_name + while IFS="|" read -r winclr clr clr0 clr1 clr2 wintrans outline shades bord stip scheme_name do ((n=n+1)) - out2+=("$(printf '%-20s' "${scheme_name}") ,conkyctl applyscheme sys $n ${1}") + [[ "$wintrans" = true ]] && bga=1 || bga=100 + out2+=("$(printf '%-20s' "${scheme_name}") ,conkyctl applyscheme sys $n ${1}") done < <(tail -n +2 "$SYSSCHEMES") out2+=("^sep($YOUR_SCHEMES)") if [[ "$1" =~ "sysinfo_" ]]; then - currcolors="${WINCLR}|${CLR}|${CLR0}|${CLR1}|${CLR2}|" - out2+=(" $SAVE_CURRSCHEME,conkyctl savescheme '${currcolors}'" "^sep()") + #currcolors="${WINCLR}|${CLR}|${CLR0}|${CLR1}|${CLR2}|" + cursettings="${WINCLR}|${CLR}|${CLR0}|${CLR1}|${CLR2}|${WINTRANS}|${OUTLINE}|${SHADES}|${BORD}|${STIP}|" + out2+=(" $SAVE_CURRSCHEME,conkyctl savescheme '${cursettings}'" "^sep()") fi n=1 - while IFS="|" read -r winclr clr clr0 clr1 clr2 scheme_name + while IFS="|" read -r winclr clr clr0 clr1 clr2 wintrans outline shades bord stip scheme_name do ((n=n+1)) - out2+=("$(printf '%-20s' "${scheme_name}") ,conkyctl applyscheme usr $n ${1}") + [[ "$wintrans" = true ]] && bga=1 || bga=100 + out2+=("$(printf '%-20s' "${scheme_name}") ,conkyctl applyscheme usr $n ${1}") #out2+=(" $schemetitle,conkyctl settheme $themefilename $1") done < <(tail -n +2 "$USERSCHEMES") @@ -769,7 +772,7 @@ if [[ "$OLD_SYNTAX" = "true" ]];then out2+=(" $DARKBG ,w2theme conkyone dark ${1}") out+=("^sep()") - fi + #fi if [[ "$WINCLR" != "#" ]];then if [ "$WINTRANS" == false ];then @@ -1132,24 +1135,32 @@ savescheme () { esac # ask for scheme name schemename=$(yad --center --width=300 --borders=20 --window-icon=mbcc --title "$SAVE_AS" --text="$DESC" --entry --entry-label="$LABEL" --entry-text="$NAME") || exit 1 - echo "${1}${schemename}" >> "$HOME/.config/colorizer/conky/userschemes.csv" + echo "${1}${schemename}" >> "$HOME/.config/colorizer/conky/c_userschemes.csv" } delscheme() { - sed -i ${1}d "$HOME/.config/colorizer/conky/userschemes.csv" + sed -i ${1}d "$HOME/.config/colorizer/conky/c_userschemes.csv" } applyscheme () { case "$1" in sys) SCHEMEFILE="/usr/share/mabox-colorizer/colorschemes/conky.csv";; - usr) SCHEMEFILE="$HOME/.config/colorizer/conky/userschemes.csv";; + usr) SCHEMEFILE="$HOME/.config/colorizer/conky/c_userschemes.csv";; esac -while IFS="|" read -r own_window_colour default_color color0 color1 color2 scheme_name +while IFS="|" read -r own_window_colour default_color color0 color1 color2 wintrans outline shades bord stip scheme_name do win_bgcolor ${own_window_colour} ${3} default_color ${default_color} ${3} color0 ${color0} ${3} color1 ${color1} ${3} color2 ${color2} ${3} + transparent ${wintrans} ${3} + shadow="no" + [[ "$outline" == true ]] && shadow="outline" + [[ "$shades" == true ]] && shadow="shadow" + shades "$shadow" ${3} + stippled_borders ${stip} ${3} + draw_borders ${bord} ${3} + done < <(awk 'NR == n' n=$2 "$SCHEMEFILE") } @@ -1157,15 +1168,22 @@ done < <(awk 'NR == n' n=$2 "$SCHEMEFILE") applyscheme_all () { case "$1" in sys) SCHEMEFILE="/usr/share/mabox-colorizer/colorschemes/conky.csv";; - usr) SCHEMEFILE="$HOME/.config/colorizer/conky/userschemes.csv";; + usr) SCHEMEFILE="$HOME/.config/colorizer/conky/c_userschemes.csv";; esac -while IFS="|" read -r own_window_colour default_color color0 color1 color2 scheme_name +while IFS="|" read -r own_window_colour default_color color0 color1 color2 wintrans outline shades bord stip scheme_name do win_bgcolor_all ${own_window_colour} default_color_all ${default_color} color0_all ${color0} color1_all ${color1} color2_all ${color2} + transparent_all ${wintrans} + shadow="no" + [[ "$outline" == true ]] && shadow="outline" + [[ "$shades" == true ]] && shadow="shadow" + shades_all "$shadow" + stippled_borders_all ${stip} + draw_borders_all ${bord} done < <(awk 'NR == n' n=$2 "$SCHEMEFILE") } @@ -1178,7 +1196,39 @@ convert_from_old () { sleep 1 startone ${1} } - +baseconky_info() { + #notify-send.sh -i mbcc "Important" "Baseconky info" + case "$LANG" in + pl*) + TITLE="Ważna informacja" + MSG="Podczas pracy nad nowymi schematami kolorów lub dostosowywaniem kolorów warto uruchomić Conky: Sysinfo - który jest bazowym Conky.\nJego kolory i inne zmienne są brane pod uwagę.\n\nUruchomić Sysinfo teraz?\n\n" + START="Tak, uruchom Sysinfo Conky" + NO="Nie" + ;; + *) + TITLE="Important info" + MSG="When working on new color schemes or customizing colors, it's worth running Conky: Sysinfo - which is the base Conky. Its colors and other variables are taken into account by Colorizer.\n\nStart Sysinfo Conky now?\n\n" + START="Yes, start Sysinfo Conky" + NO="No" + ;; + esac + cmd=( + yad --center --width=360 --borders=20 --window-icon=mbcc --image=colorizer + --title "${TITLE}" + --text="${MSG}" + --button="${START}:1" + --button="${NO}:0" + ) + "${cmd[@]}" + exval=$? + #notify-send.sh -t 10000 "Exval" "${exval}" + case $exval in + 1) startone "$HOME/.config/conky/sysinfo_mbcolor.conkyrc";; + 0) : ;; + 252): ;; + esac + colorizer-conky -s +} case "$1" in transparent_all) transparent_all "$2";; transparent) transparent "$2" "$3";; @@ -1231,5 +1281,6 @@ case "$1" in applyscheme_all) applyscheme_all "$2" "$3";; netdevice) netdevice ;; convert_from_old) convert_from_old "$2";; + baseconky_info) baseconky_info;; *) : ;; esac diff --git a/bin/mbclr b/bin/mbclr index d5f585e..70cddf5 100755 --- a/bin/mbclr +++ b/bin/mbclr @@ -54,7 +54,8 @@ case "$LANG" in GRAYS="Shades of Gray" ;; esac - +ccol_ind=" " +gtkthemename=$(grep gtk-theme ~/.config/gtk-3.0/settings.ini |cut -d'=' -f2) main () { #read WALLPAPER<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) @@ -149,7 +150,7 @@ out+=("^sep()") out+=(" $ACCENT_COLORS,^checkout(accents)") out2+=("^tag(accents)") out2+=("^sep($ACCENT_COLORS)") -for i in ${accents[@]};do out2+=("$i ,$2 $3 '${i}' ${6};${5}");done +for i in ${accents[@]};do out2+=("$i ${ccol_ind},$2 $3 '${i}' ${6};${5}");done out+=("^sep()") mapfile -t gtkcolors < <( gtkcolors.py 2>/dev/null| grep -v None|awk '{print "#"$2}'|sort|uniq) @@ -157,7 +158,8 @@ if [ "${#gtkcolors[@]}" -gt 0 ];then out+=("$GTKCOLORS,^checkout(gtkcols)") out2+=("^tag(gtkcols)") out2+=("^sep($GTKCOLORS)") -for i in ${gtkcolors[@]};do out2+=("$i ,$2 $3 '${i}' ${6};${5}");done +out2+=("^sep($gtkthemename)") +for i in ${gtkcolors[@]};do out2+=("$i ${ccol_ind},$2 $3 '${i}' ${6};${5}");done out+=("^sep()") fi @@ -167,14 +169,14 @@ out2+=("^tag(grayscol)") out2+=("^sep($GRAYS)") for i in "${grays[@]}" do -out2+=("$i ,$2 $3 '${i}' ${6};${5}") +out2+=("$i ${ccol_ind},$2 $3 '${i}' ${6};${5}") done out+=("^sep($WALLPAPER_COLORS)") for i in "${wallcolors[@]}" do -out+=("$i ,$2 $3 '${i}' ${6};${5}") +out+=("$i ${ccol_ind},$2 $3 '${i}' ${6};${5}") done @@ -186,7 +188,7 @@ out2+=("^sep($SHADES_OF $1)") for i in 3 25 2 15 1 05; do clr=$(pastel lighten 0.$i "${1}" | pastel format hex) if [ "${clr}" != "#ffffff" ];then -out2+=("$clr ,$2 $3 '${clr}' ${6};${5}") +out2+=("$clr ${ccol_ind},$2 $3 '${clr}' ${6};${5}") fi done @@ -196,7 +198,7 @@ out2+=("^sep()") for i in 05 1 15 2 25 3; do clr=$(pastel darken 0.$i "${1}" | pastel format hex) if [ "${clr}" != "#000000" ];then -out2+=("$clr ,$2 $3 '${clr}' ${6};${5}") +out2+=("$clr ${ccol_ind},$2 $3 '${clr}' ${6};${5}") fi done # Shades ENG @@ -209,7 +211,7 @@ out2+=("^sep($SATURATION)") for i in 9 8 7 6 5 4 3 2 1; do clr=$(pastel desaturate 0.$i "${1}" | pastel format hex) if [ "${clr}" != "${oldclr}" ];then -out2+=("$clr ,$2 $3 '${clr}' ${6};${5}") +out2+=("$clr ${ccol_ind},$2 $3 '${clr}' ${6};${5}") oldclr=${clr} fi done @@ -219,7 +221,7 @@ out2+=("^sep()") for i in 1 2 3 4 5 6 7 8 9; do clr=$(pastel saturate 0.$i "${1}" | pastel format hex) if [ "${clr}" != "${oldclr}" ];then -out2+=("$clr ,$2 $3 '${clr}' ${6};${5}") +out2+=("$clr ${ccol_ind},$2 $3 '${clr}' ${6};${5}") oldclr=${clr} fi done @@ -230,14 +232,14 @@ out2+=("^tag(rotate_hsl)") out2+=("^sep($ROTATE_HSL_HUE)") for i in {135..15..15};do clr=$(pastel rotate -- -$i "${1}" |pastel format hex) -out2+=("$clr -$i°,$2 $3 '${clr}' ${6};${5}") +out2+=("$clr ${ccol_ind} -$i°,$2 $3 '${clr}' ${6};${5}") done out2+=("^sep()") out2+=(" $CURRENT $1 ,$2 $3 '${1}' ${6};${5}") out2+=("^sep()") for i in {15..135..15};do clr=$(pastel rotate $i "${1}" |pastel format hex) -out2+=("$clr $i°,$2 $3 '${clr}' ${6};${5}") +out2+=("$clr ${ccol_ind} $i°,$2 $3 '${clr}' ${6};${5}") done # ROTATE HSL END diff --git a/share/mabox-colorizer/colorschemes/conky.csv b/share/mabox-colorizer/colorschemes/conky.csv index f35da68..8e3897c 100644 --- a/share/mabox-colorizer/colorschemes/conky.csv +++ b/share/mabox-colorizer/colorschemes/conky.csv @@ -1,10 +1,12 @@ -WINCLR | CLR | CLR0 | CLR1 | CLR2 |scheme_name -#142c2c|#309552|#accdc7|#61c4bc|#E8CB2D|Istredd default -#282936|#e9e9f4|#ea51b2|#00f769|#ebff87|Dracula -#282828|#ebdbb2|#98971a|#d79921|#cc241d|Gruvbox Dark -#2D2A2E|#AB9DF2|#FCFCFA|#78DCE8|#A9DC76|Monokai Pro -#2E3440|#B48EAD|#D8DEE9|#88C0D0|#EBCB8B|Nord -#184956|#adbcbc|#ff665c|#84c747|#ebc13d|Selenized Dark -#ECE3CC|#3A4D53|#AD8900|#CC1729|#428B00|Selenized Light -#151718|#D6D6D6|#CD3F45|#9FCA56|#E6CD69|Seti -#1d1f21|#b294bb|#c5c8c6|#81a2be|#b5bd68|Tomorrow Nigh +WINCLR | CLR | CLR0 | CLR1 | CLR2 |WINTRANS|OUTLINE|SHADES | BORD | STIP |scheme_name +#142c2c|#309552|#accdc7|#61c4bc|#E8CB2D|false|false|false|true|0|Istredd default +#282936|#e9e9f4|#ea51b2|#00f769|#ebff87|false|false|false|false|1|Dracula +#282828|#ebdbb2|#98971a|#d79921|#cc241d|false|false|false|false|1|Gruvbox Dark +#2D2A2E|#AB9DF2|#FCFCFA|#78DCE8|#A9DC76|false|false|false|false|1|Monokai Pro +#2E3440|#B48EAD|#D8DEE9|#88C0D0|#EBCB8B|false|false|false|false|1|Nord +#f8f8f8|#181415|#282828|#0e8420|#e95620|true|false|true|false|1|transparent DarkTxt +#1b1b1b|#bbc8c8|#f2f2f2|#84c747|#ebc13d|true|false|false|false|1|transparent WhiteTxt +#184956|#adbcbc|#ff665c|#84c747|#ebc13d|false|false|false|false|1|Selenized Dark +#ECE3CC|#3A4D53|#AD8900|#CC1729|#428B00|false|false|false|false|1|Selenized Light +#151718|#D6D6D6|#CD3F45|#9FCA56|#E6CD69|false|false|false|false|1|Seti +#1d1f21|#b294bb|#c5c8c6|#81a2be|#b5bd68|false|false|false|false|1|Tomorrow Nigh