From 6482e8ddfcf0dbc093c511d206c8283828636aaa Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Tue, 5 Sep 2023 17:18:04 +0200 Subject: [PATCH] save/restore menus --- bin/colorizer | 18 +- bin/colorizer-cava | 8 +- bin/colorizer-conky | 18 +- bin/colorizer-fonts | 20 +- bin/colorizer-menus | 396 ++++++++++++++----- bin/colorizer-ob | 14 +- bin/colorizer-pyradio | 15 +- bin/conkyctl | 2 +- bin/jgctl | 67 +++- bin/transparent-cava | 45 +++ share/mabox-colorizer/colorschemes/menus.csv | 4 + 11 files changed, 462 insertions(+), 145 deletions(-) create mode 100755 bin/transparent-cava create mode 100644 share/mabox-colorizer/colorschemes/menus.csv diff --git a/bin/colorizer b/bin/colorizer index 735f653..b5ae917 100755 --- a/bin/colorizer +++ b/bin/colorizer @@ -707,8 +707,8 @@ if [[ "$1" == "-s" ]]; then [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius [ -z $jgmenu_use_borders ] && menu_border=0 - JGWIDTH=$((jgtools_padding + 278 + jgtools_padding)) - MENU_PADDING_TOP=$((jgtools_padding + 158)) + JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) + MENU_PADDING_TOP=$((jgtools_padding + 150)) THUMBDIR="$HOME/.cache/colorizer/thumbs" mkdir -p ${THUMBDIR} @@ -720,8 +720,8 @@ if [[ "$1" == "-s" ]]; then # colors n=0 m=0 - X=$((jgtools_padding + 12)) - Y=$((jgtools_padding + 104)) + X=$((jgtools_padding + 4)) + Y=$((jgtools_padding + 100)) for i in "${w[@]}" do if [[ "$n" -lt "10" ]];then @@ -754,11 +754,11 @@ else esac fi cat < ${MENU_ITEMS} -@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,${THUMB} -@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 8)),270,20,0,left,top,#222222 20,#222222 70, -@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 120)),270,34,0,left,top,#222222 20,#222222 70, -@text,,$((jgtools_padding + 12)),$((jgtools_padding + 2)),270,30,0,left,top,#FFFFFF ,${WINCLR}, ${THGEN} $STATE -@text,,$((jgtools_padding + 198)),$((jgtools_padding + 124)),120,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer +@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB} +@rect,,$((jgtools_padding)),$((jgtools_padding + 4)),270,20,0,left,top,#222222 20,#222222 70, +@rect,,$((jgtools_padding)),$((jgtools_padding + 116)),270,34,0,left,top,#222222 20,#222222 70, +@text,,$((jgtools_padding + 12)),$((jgtools_padding)),270,30,0,left,top,#FFFFFF ,${WINCLR}, ${THGEN} $STATE +@text,,$((jgtools_padding + 194)),$((jgtools_padding + 120)),120,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer $(printf '%s\n' "${dots[@]}") #@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 34)),270,120,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer.png $(printf '%s\n' "${out[@]}") diff --git a/bin/colorizer-cava b/bin/colorizer-cava index 82c03cf..2664f69 100755 --- a/bin/colorizer-cava +++ b/bin/colorizer-cava @@ -54,6 +54,7 @@ Możesz je więc przesuwać lub zmieniać rozmiar tak jak każde i COLOR="Jednolity kolor" REVERSE_GRADIENT="Odwróć kolory gradientu" START_CAVA="Uruchom Cava" + STOP_CAVA="Zakończ Cava" GENERATEFROMWP="Generuj z kolorów tapety..." LIGHTBG="Jasne do ciemnego" DARKBG="Ciemne do jesnego" @@ -82,6 +83,7 @@ So you can move or resize it like any other window\n \ COLOR="Solid Color" REVERSE_GRADIENT="Reverse gradient's colors" START_CAVA="Start Cava" + STOP_CAVA="Stop Cava" GENERATEFROMWP="Generate from wallpaper colors..." LIGHTBG="Light to Dark" DARKBG="Dark to Light" @@ -118,8 +120,8 @@ fi FGT=$(pastel textcolor ${FGC}|pastel format hex) } getvalues + pgrep -f cavatransparent > /dev/null && out+=("󰺢 $STOP_CAVA,mb-music cavakill;$me") || out+=("󰺢 $START_CAVA,mb-music cavastart;$me") out+=("^sep($COLORIZE_CAVA)") - out+=(" ${FGC} $COLOR,^pipe(mbclr '$FGC' cavactl foreground Cava_Bar_Color '$me')") out+=("^sep($GRADIENT)") out+=(" $PREGRADIENT,^pipe(mbgrad cava)") @@ -167,7 +169,7 @@ if [[ "$1" == "-s" ]]; then source "$CNF_FILE" out+=("^sep()") - out+=(" ⮜⮜⮜ Colorizer,colorizer -s") + out+=(" ${arrow_string_left} Colorizer,colorizer -s") if [[ "$colorizer_size" == "full" ]];then eval $(xdotool getdisplaygeometry --shell) @@ -187,7 +189,7 @@ if [[ "$1" == "-s" ]]; then [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius [ -z $jgmenu_use_borders ] && menu_border=0 JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) - MENU_PADDING_TOP=$((jgtools_padding + 158)) + MENU_PADDING_TOP=$((jgtools_padding + 150)) #WALLPAPER read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) diff --git a/bin/colorizer-conky b/bin/colorizer-conky index 5865cdf..03eb566 100755 --- a/bin/colorizer-conky +++ b/bin/colorizer-conky @@ -388,7 +388,7 @@ if [[ "$1" == "-s" ]]; then source $HOME/.config/colorizer/colorizer.conf out+=("^sep()") - out+=(" ⮜⮜⮜ Colorizer,colorizer -s") + out+=(" ${arrow_string_left} Colorizer,colorizer -s") if [[ "$colorizer_size" == "full" ]];then eval $(xdotool getdisplaygeometry --shell) @@ -406,8 +406,8 @@ if [[ "$1" == "-s" ]]; then [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius [ -z $jgmenu_use_borders ] && menu_border=0 - JGWIDTH=$((jgtools_padding + 278 + jgtools_padding)) - MENU_PADDING_TOP=$((jgtools_padding + 158)) + JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) + MENU_PADDING_TOP=$((jgtools_padding + 150)) #WALLPAPER read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) @@ -428,13 +428,13 @@ if [[ "$1" == "-s" ]]; then mkconfigfile cat < ${MENU_ITEMS} -@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,${THUMB} -@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 120)),270,34,0,left,top,#222222 20,#222222 70, +@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB} +@rect,,$((jgtools_padding)),$((jgtools_padding + 112)),270,34,0,left,top,#222222 20,#222222 70, #@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-conky.png -@text,,$((jgtools_padding + 158)),$((jgtools_padding + 124)),120,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer Conky -@rect,,$((jgtools_padding + 244)),$((jgtools_padding + 6)),29,60,0,left,top,#FFFFFF 30,${WINCLR} 60, -@rect,,$((jgtools_padding + 5)),$((jgtools_padding + 92)),29,60,0,left,top,#FFFFFF 30,${WINCLR} 60, -@rect,,$((jgtools_padding + 36)),$((jgtools_padding + 112)),29,40,0,left,top,#FFFFFF 30,${WINCLR} 60, +@text,,$((jgtools_padding + 154)),$((jgtools_padding + 116)),120,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer Conky +@rect,,$((jgtools_padding + 239)),$((jgtools_padding + 2)),29,60,0,left,top,#FFFFFF 30,${WINCLR} 60, +@rect,,$((jgtools_padding + 2)),$((jgtools_padding + 88)),29,60,0,left,top,#FFFFFF 30,${WINCLR} 60, +@rect,,$((jgtools_padding + 34)),$((jgtools_padding + 108)),29,40,0,left,top,#FFFFFF 30,${WINCLR} 60, $(printf '%s\n' "${out[@]}") $(printf '%s\n' "${out2[@]}") EOF diff --git a/bin/colorizer-fonts b/bin/colorizer-fonts index f6fa8c1..b2cd937 100755 --- a/bin/colorizer-fonts +++ b/bin/colorizer-fonts @@ -138,6 +138,12 @@ fi read FONTDEF <<< "$(grep "font .*=.*,$" ${BASECONKY} | cut -d'=' -f2,3 |cut -d"'" -f2)" C_FONT=${FONTDEF%:*} C_FONTSIZE=${FONTDEF#*=} + +read OUTLINE <<< "$(grep draw_outline ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)" +read SHADES <<< "$(grep draw_shades ${BASECONKY} | cut -d'=' -f2 | cut -d"," -f1)" +SHADOWS="no" +[[ "$OUTLINE" == "true" ]] && SHADOWS="outline" +[[ "$SHADES" == "true" ]] && SHADOWS="shadow" } getvalues @@ -342,7 +348,7 @@ if [[ "$1" == "-s" ]]; then source "$CNF_FILE" out+=("^sep()") - out+=(" ⮜⮜⮜ Colorizer,colorizer -s") + out+=(" ${arrow_string_left} Colorizer,colorizer -s") if [[ "$colorizer_size" == "full" ]];then eval $(xdotool getdisplaygeometry --shell) @@ -361,8 +367,8 @@ if [[ "$1" == "-s" ]]; then [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius [ -z $jgmenu_use_borders ] && menu_border=0 - JGWIDTH=$((jgtools_padding + 278 + jgtools_padding)) - MENU_PADDING_TOP=$((jgtools_padding + 158)) + JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) + MENU_PADDING_TOP=$((jgtools_padding + 150)) #WALLPAPER read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) @@ -385,12 +391,12 @@ if [[ "$1" == "-s" ]]; then [[ "$GR" == "1" ]] && clr=${GR_FROM} || clr=${FG} cat < ${MENU_ITEMS} -@icon,,$((jgtools_padding+4)),$((jgtools_padding+4)),270,150,4,left,top,,,${THUMB} +@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB} #@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-conky.png -@rect,,$((jgtools_padding+4)),$((jgtools_padding + 120)),270,28,0,left,top,#222222 20,#222222 70, -@text,,$((jgtools_padding + 14)),$((jgtools_padding + 110)),100,28,0,left,top,#FFFFFF ,${WINCLR}, -@text,,$((jgtools_padding + 132)),$((jgtools_padding + 120)),150,28,0,left,top,#FFFFFF ,${WINCLR},Mabox Fonts config +@rect,,$((jgtools_padding)),$((jgtools_padding + 116)),270,28,0,left,top,#222222 20,#222222 70, +@text,,$((jgtools_padding + 10)),$((jgtools_padding + 106)),100,28,0,left,top,#FFFFFF ,${WINCLR}, +@text,,$((jgtools_padding + 128)),$((jgtools_padding + 116)),150,28,0,left,top,#FFFFFF ,${WINCLR},Mabox Fonts config $(printf '%s\n' "${out[@]}") diff --git a/bin/colorizer-menus b/bin/colorizer-menus index 200cf7f..635ed08 100755 --- a/bin/colorizer-menus +++ b/bin/colorizer-menus @@ -18,6 +18,27 @@ +SYSSCHEMES="/usr/share/mabox-colorizer/colorschemes/menus.csv" +USERSCHEMES="$HOME/.config/colorizer/menus/userschemes.csv" + + +### Wallpaper colors +WALLPALDIR="$HOME/.cache/colorizer/palettes" +mkdir -p "$WALLPALDIR" +read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) +NAME=${WALLPATH////_} +if [[ "${NAME}" =~ ^_home_.* ]]; then +n=${#HOME} +((n++)) +NAME=${NAME:${n}} +fi + +if [ ! -f "$WALLPALDIR/$NAME.clr" ]; then +convert ${WALLPATH} -resize 25% -colors 16 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,7)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr" +fi +mapfile -t w < "$WALLPALDIR/$NAME.clr" + + me="colorizer-menus -s" . $HOME/.config/mabox/mabox.conf @@ -45,6 +66,28 @@ fi case "$LANG" in pl*) MENU_THEME="Motyw menu" + QUICK_TWEAKS="Ustawienia główne" + SCHEMES="Motywy kolorystycznie" + SYSTEM_SCHEMES="Systemowe" + YOUR_SCHEMES="Moje motywy" + SAVE_CURRSCHEME="Zapisz aktualną kolorystykę jako..." + OPEN_SCHEMEFILE="Odwórz plik ze schematami w edytorze" + COLORSCHEME="Schemat kolorów" + APPLY_SCHEME="Zastosuj" + DELETE="Usuń" + DELETE_SCHEME="Usuń schemat kolorów" + BORDER="Obramowanie" + PADDING="Margines wewnętrzny" + RADIUS="Zaokrąglone rogi" + SUBSPACING="Odstęp submenu" + LINE_HEIGHT="Wysokość lini" + ARROW_STRING="Znak strzałki" + ARROW_STRING_LEFT="Znak strzałki lewej" + MBG_OPACITY="(Nie)przeźroczystość Menu" + SIZING="Rozmiar menu" + WIDE="szerokie" + NORMAL="normalne" + TIGHT="wąskie" GENERATEFROMWP="Generuj z kolorów tapety..." LIGHTBG="Jasne tło" DARKBG="Ciemne tło" @@ -61,10 +104,11 @@ case "$LANG" in TOP_RIGHT="od góry z prawej (top_right)" BOTTOM_LEFT="z dołu od lewej (bottom_left)" BOTTOM_RIGHT="z dołu od prawej (bottom_right)" - PRE_GRADIENTS="Gotowe gradienty" + PRE_GRADIENTS="Zastosuj gradient" GRADIENT_REVERSE="Odwróć kolory Gradientu" ITEM="Pozycja (element) menu " FONT="Czcionka" + FONTS="Czcionki" INCREASE="Powiększ do" DECREASE="Pomniejsz do" FONT_CUSTOM="Wybierz czcionkę i rozmiar..." @@ -73,13 +117,17 @@ case "$LANG" in ITEM_FONT="Czcionka elementu" TITLE_FONT="Czcionka nagłówka" COLOR_NORM_FG="Kolor tekstu" - COLOR_SEL_BG="Tło aktywnej pozycji" - COLOR_SEL_FG="Tekst aktywnej pozycji" - COLOR_SEL_BORDER="Obramowanie akt. poz." + SEL_ITEM="Aktywny element (akcent)" + COLOR_SEL_BG="Tło" + COLOR_SEL_FG="Tekst" + COLOR_SEL_BORDER="Obramowanie" + I_BORDER="Obramowanie" + I_RADIUS="i Zaokrąglenie" ITEM_BORDER="Obramowanie (px)" ITEM_RADIUS="Zaokrąglenie (px)" COLOR_NORM_BG="Tło" SEPARATOR_TITLE="Separator/Nagłówek" + TITLE="Nagłówek" COLOR_TITLE_BG="Tło nagłówka" COLOR_TITLE_FG="Kolor tekstu nagłówka" COLOR_TITLE_BORDER="Kolor obramowania" @@ -98,11 +146,33 @@ case "$LANG" in ;; *) MENU_THEME="Menu theme" + QUICK_TWEAKS="Global Settings/Quick Tweaks" + SCHEMES="Color Schemes" + SYSTEM_SCHEMES="System colorschemes" + YOUR_SCHEMES="My colorschemes" + SAVE_CURRSCHEME="Save current colors as..." + OPEN_SCHEMEFILE="Open schemes file in editor" + COLORSCHEME="Color Scheme" + APPLY_SCHEME="Apply colorscheme" + DELETE="Delete" + DELETE_SCHEME="Delete colorscheme" + BORDER="Menu Border" + PADDING="Padding" + RADIUS="Rounded Corners" + SUBSPACING="Submenu Spacing" + LINE_HEIGHT="Line height" + ARROW_STRING="Arrow string" + ARROW_STRING_LEFT="Left Arrow string" + MBG_OPACITY="Menu BG Opacity" + SIZING="Menu sizing" + WIDE="wide" + NORMAL="normal" + TIGHT="tight" GENERATEFROMWP="Generate from wallpaper colors..." LIGHTBG="Light Background" DARKBG="Dark Background" - COLOR_MENU_BG="Background" - COLOR_MENU_BG_TO="Background to (gradient)" + COLOR_MENU_BG="Background (BG)" + COLOR_MENU_BG_TO="BG to (gradient)" COLOR_MENU_BORDER="Menu Border" GRADIENT_POS="Gradient direction" NONE="none" @@ -114,10 +184,11 @@ case "$LANG" in TOP_RIGHT="top_right" BOTTOM_LEFT="bottom_left" BOTTOM_RIGHT="bottom_right" - PRE_GRADIENTS="Predefined gradients" + PRE_GRADIENTS="Apply gradient" GRADIENT_REVERSE="Reverse gradient colors" ITEM="Item" FONT="Font" + FONTS="Fonts" INCREASE="Increase to" DECREASE="Decrease to" FONT_CUSTOM="Select custom font and size..." @@ -126,13 +197,17 @@ case "$LANG" in ITEM_FONT="Item Font" TITLE_FONT="Title Font" COLOR_NORM_FG="Text Color" - COLOR_SEL_BG="Selected Item Background" - COLOR_SEL_FG="Selected Item Text" - COLOR_SEL_BORDER="Selected Item Border" + SEL_ITEM="Selected Item (accent)" + COLOR_SEL_BG="Background" + COLOR_SEL_FG="Text" + COLOR_SEL_BORDER="Border" + I_BORDER="Item Border" + I_RADIUS="and Radius" ITEM_BORDER="Item Border (px)" ITEM_RADIUS="Item Radius (px)" COLOR_NORM_BG="Item Background" SEPARATOR_TITLE="Separator/Title" + TITLE="Title" COLOR_TITLE_BG="Title Background" COLOR_TITLE_FG="Title Foreground" COLOR_TITLE_BORDER="Title Border color " @@ -175,35 +250,155 @@ getvalues () { } getvalues +# Current colors to file +currcolors="${MBG}|${MBGT}|${MBORDER}|${TBG}|${TFG}|${TBORDER}|${NORMBG}|${NFG}|${SBG}|${SFG}|${SBORDER}|${SEPFG}|${GRADIENT}|" +#echo "${currcolors}" > ~/.config/mabox/.menu_colors +if [ ! -f "$USERSCHEMES" ]; then + mkdir -p "$HOME/.config/colorizer/menus/" + echo " MBG | MBGT |MBORDER| TBG | TFG |TBORDER|NORMBG | NFG | SBG | SFG |SBORDER| SEPFG |GRADIENT|scheme_name" > "$USERSCHEMES" +fi out+=("^sep($MENU_THEME: ${jgmenu_theme})") -out+=("Quick Menu tweaks,^checkout(tweaks)") +out+=("$QUICK_TWEAKS,^checkout(tweaks)") out2+=("^tag(tweaks)") + out2+=("^sep(Overall style)") + +###### +out2+=("$BORDER [ ${jgtools_border:-0}px ],^checkout(mborder)") +out2+=("$PADDING [ ${jgtools_padding:-0}px ],^checkout(mpadding)") +#out2+=("$RADIUS [ ${jgtools_radius:-0} ],^checkout(mradius)") +out2+=("$SUBSPACING [ ${submenu_spacing:-0}px ],^checkout(subspacing)") +out2+=("^sep()") +out2+=("$LINE_HEIGHT [ $item_height_factor% ],^checkout(lineheight)") +out2+=("^sep()") +out2+=("$ARROW_STRING [ $arrow_string ],^checkout(arrow)") +out2+=("$ARROW_STRING_LEFT [ $arrow_string_left ],^checkout(arrowleft)") + + +out3+=("^tag(mborder)") +out3+=("^sep($BORDER)") +for i in 0 1 2 3 4 5 6 8 10 12; do [[ "$jgtools_border" == $i ]] && out3+=(" $(printf "%3s,%s" "$i" "mb-setvar jgtools_border=${i};$me")") || out3+=(" $(printf "%3s,%s" "$i" "mb-setvar jgtools_border=${i};$me")");done + +out3+=("^tag(mpadding)") +out3+=("^sep($PADDING)") +for i in 0 2 4 6 8 10 12 14 16 18 20 22 24 28 32 40; do [[ "$jgtools_padding" == $i ]] && out3+=(" $(printf "%3s,%s" "$i" "mb-setvar jgtools_padding=${i};$me")") || out3+=(" $(printf "%3s,%s" "$i" "mb-setvar jgtools_padding=${i};$me")");done + +#out3+=("^tag(mradius)") +#out3+=("^sep($RADIUS)") +#for i in 0 1 2 3 4 6 8 12 14 16 18 20 40; do out3+=("$(printf "%3s,%s" "$i" "mb-setvar jgtools_radius=${i};$me")");done + +out3+=("^tag(subspacing)") +out3+=("^sep($SUBSPACING)") +for i in -20 -12 -10 -8 -6 -4 -2 0 1 2 4 6 8 10 12 14 16 18 20; do [[ "$submenu_spacing" == $i ]] && out3+=(" $(printf "%4s,%s" "$i" "mb-setvar submenu_spacing=${i};$me")") || out3+=(" $(printf "%4s,%s" "$i" "mb-setvar submenu_spacing=${i};$me")");done + +out3+=("^tag(lineheight)") +out3+=("^sep($LINE_HEIGHT)") + for i in 160 180 200 220 240 280 300; do [[ "$item_height_factor" == $i ]] && out3+=(" $(printf "%4s%%,%s" "$i" "mb-setvar item_height_factor=${i};$me")") || out3+=(" $(printf "%4s%%,%s" "$i" "mb-setvar item_height_factor=${i};$me")");done + +out3+=("^tag(arrow)") +out3+=("^sep($ARROW_STRING)") +for i in "" "" "" "" "" "" "󰔰" "󰮺" "" "壟" "" "" "" "" "" "󰋇" "..." ":." "." "+" "^" "-" "_" "" "" "󰞔" "" ""; do [[ "$arrow_string" == $i ]] && out3+=(">> $i <<,$me") || out3+=(" $i,mb-setvar arrow_string=${i};$me");done + +out3+=("^tag(arrowleft)") +out3+=("^sep($ARROW_STRING_LEFT)") +for i in "" "" "" "" "" "" "󰶢" "󰮹" "" "鹿" "" "" "" "" "" "󰩔"; do [[ "$arrow_string_left" == $i ]] && out3+=(">> $i <<,$me") || out3+=(" $i,mb-setvar arrow_string_left=${i};$me");done + +out2+=("^sep()") +out2+=("$MBG_OPACITY,^checkout(mbgopacity") +out3+=("^tag(mbgopacity)") +out3+=("^sep(mbgopacity)") +out3+=("100% Opaque,jgctl tweak opacity 100;$me") +out3+=("90%,jgctl tweak opacity 90;$me") +out3+=("80%,jgctl tweak opacity 80;$me") +out3+=("60%,jgctl tweak opacity 60;$me") +out3+=("50%,jgctl tweak opacity 50;$me") +out3+=("40%,jgctl tweak opacity 40;$me") +out3+=("30%,jgctl tweak opacity 30;$me") +out3+=("20%,jgctl tweak opacity 20;$me") +out3+=("10%,jgctl tweak opacity 10;$me") +out3+=("0% Fully transparent,jgctl tweak opacity 0;$me") + +out2+=("^sep()") out2+=("Solid Color,jgctl tweak solid;$me") out2+=("Gradient,jgctl tweak gradient;$me") -out2+=("^sep(Opacity)") -out2+=("100% Opaque,jgctl tweak opacity 100;$me") -out2+=("80%,jgctl tweak opacity 80;$me") -out2+=("60%,jgctl tweak opacity 60;$me") -out2+=("40%,jgctl tweak opacity 40;$me") -out2+=("30%,jgctl tweak opacity 30;$me") -out2+=("20%,jgctl tweak opacity 20;$me") -out2+=("10%,jgctl tweak opacity 10;$me") -out2+=("0% Fully transparent,jgctl tweak opacity 0;$me") -out2+=("^sep(MENU_PADDING)") -out2+=("wide,jgctl tweak padding wide;$me") -out2+=("normal,jgctl tweak padding normal;$me") -out2+=("tight,jgctl tweak padding tight;$me") + + +out2+=("^sep($SIZING)") +out2+=("$WIDE,jgctl tweak sizing wide;$me") +out2+=("$NORMAL,jgctl tweak sizing normal;$me") +out2+=("$TIGHT,jgctl tweak sizing tight;$me") + + + +#### COLOR SCHEMES +out+=("$SCHEMES,^checkout(schemes)") +out2+=("^tag(schemes)") +out2+=("^sep($SCHEMES)") +out2+=("^sep($SYSTEM_SCHEMES)") + +n=1 +while IFS="|" read -r mbg mbgt mborder tbg tfg tborder normbg nfg sbg sfg sborder sepfg grad scheme_name +do +((n=n+1)) +case "$grad" in + none)icon="󰄱";; + top)icon="";; + right)icon="";; + bottom)icon="";; + left)icon="";; + top_left)icon="";; + top_right)icon="";; + bottom_left)icon="";; + bottom_right)icon="";; +esac +out2+=("$(printf '%-20s' "${scheme_name}") item title [ sel ] ${icon} ,jgctl applyscheme sys $n;$me") +done < <(tail -n +2 "$SYSSCHEMES") + +out2+=("^sep($YOUR_SCHEMES)") +out2+=(" $SAVE_CURRSCHEME,jgctl savescheme '${currcolors}';$me") +out2+=(" $OPEN_SCHEMEFILE,xdg-open $USERSCHEMES") +out2+=("^sep()") +n=1 +while IFS="|" read -r mbg mbgt mborder tbg tfg tborder normbg nfg sbg sfg sborder sepfg grad scheme_name +do +((n=n+1)) +case "$grad" in + none)icon="󰄱";; + top)icon="";; + right)icon="";; + bottom)icon="";; + left)icon="";; + top_left)icon="";; + top_right)icon="";; + bottom_left)icon="";; + bottom_right)icon="";; +esac +out2+=("$(printf '%-20s' "${scheme_name}") item title [ sel ] ${icon} ,^checkout(sch${n})") +out3+=("^tag(sch${n}") +out3+=("^sep($COLORSCHEME: ${scheme_name})") +out3+=(" $APPLY_SCHEME,jgctl applyscheme usr ${n};$me") +out3+=("^sep($DELETE)") +out3+=("󰗨 $DELETE_SCHEME ${scheme_name},jgctl delscheme ${n};$me") +done < <(tail -n +2 "$USERSCHEMES") + + + +out2+=("^sep($GENERATEFROMWP)") +out2+=(" $LIGHTBG ,w2theme menu light;$me") +out2+=(" $DARKBG ,w2theme menu dark;$me") + out+=("^sep(Menu)") out+=("$(printf '%3s' "$MBGA") $COLOR_MENU_BG,^pipe(mbclr '$MBG' jgctl color_menu_bg '${COLOR_MENU_BG}' '$me')") out+=("$(printf '%3s' "$MBGTA") $COLOR_MENU_BG_TO,^pipe(mbclr '$MBGT' jgctl color_menu_bg_to '${COLOR_MENU_BG_TO}' '$me')") +if [[ "$jgtools_border" != "0" ]];then out+=("$(printf '%3s' "$MBORDERA") $COLOR_MENU_BORDER,^pipe(mbclr '$MBORDER' jgctl color_menu_border '${COLOR_MENU_BORDER}' '$me')") +fi out+=("^sep()") case "$GRADIENT" in - none)icon="";; + none)icon="󰄱";; top)icon="";; right)icon="";; bottom)icon="";; @@ -214,34 +409,41 @@ case "$GRADIENT" in bottom_right)icon="";; esac -out+=("$icon $GRADIENT_POS [ $GRADIENT ],^checkout(gradientpos)") -#for i in $(pastel gradient "$MBGT" "$MBG" -n 13|pastel format hex) -#do -#gradrev+=(" ") -#done +out+=("$icon $GRADIENT_POS [ $GRADIENT ],^checkout(gradientpos)") -#out+=("$(printf '%s' "${gradrev[@]}") 凌 $GRADIENT_REVERSE,jgctl gradient '${MBGT}' '${MBG}';$me") -out+=(" 凌 $GRADIENT_REVERSE,jgctl gradient '${MBGT}' '${MBG}';$me") +out+=(" $GRADIENT_REVERSE,jgctl gradient '${MBGT}' '${MBG}';$me") -#for i in $(pastel gradient "$MBG" "$MBGT" -n 13|pastel format hex) -#do -#grad+=(" ") -#done -#out+=("$(printf '%s' "${grad[@]}") $PRE_GRADIENTS,^pipe(mbgrad menu)") out+=(" $PRE_GRADIENTS,^pipe(mbgrad menu)") out+=("^sep($ITEM)") -out+=("󰛖 $FONT [ $menu_font_family $menu_font_size ],^checkout(mitemfont)") + out+=("$(printf '%3s' "$NFGA") AbCd $COLOR_NORM_FG,^pipe(mbclr '$NFG' jgctl color_norm_fg '${COLOR_NORM_FG}' '$me')") -out+=("$(printf '%3s' "$SBGA") $COLOR_SEL_BG,^pipe(mbclr '$SBG' jgctl color_sel_bg '${COLOR_SEL_BG}' '$me')") -out+=("$(printf '%3s' "$SFGA") AbCd $COLOR_SEL_FG,^pipe(mbclr '$SFG' jgctl color_sel_fg '${COLOR_SEL_FG}' '$me')") -out+=("$(printf '%3s' "$SBORDERA") $COLOR_SEL_BORDER,^pipe(mbclr '$SBORDER' jgctl color_sel_border '${COLOR_SEL_BORDER}' '$me')") + out+=("^sep()") [[ ! -z "$NORMBG" ]] && out+=("$(printf '%3s' "$NORMBGA") $COLOR_NORM_BG,^pipe(mbclr '$NORMBG' jgctl color_norm_bg '${COLOR_NORM_BG}' '$me')" "^sep()") -out+=("$ITEM_BORDER [ $IBORDER ],^checkout(itemborder)") -out+=("$ITEM_RADIUS [ $IRADIUS ],^checkout(itemradius)") +out+=("$I_BORDER [ $IBORDER ] $I_RADIUS [ $IRADIUS ],^checkout(itemborder_radius)") + +out+=("^sep($SEL_ITEM)") +out+=("$(printf '%3s' "$SBGA") $COLOR_SEL_BG,^pipe(mbclr '$SBG' jgctl color_sel_bg '${COLOR_SEL_BG}' '$me')") +out+=("$(printf '%3s' "$SFGA") AbCd $COLOR_SEL_FG,^pipe(mbclr '$SFG' jgctl color_sel_fg '${COLOR_SEL_FG}' '$me')") +if [[ "$IBORDER" != "0" ]];then +out+=("$(printf '%3s' "$SBORDERA") $COLOR_SEL_BORDER,^pipe(mbclr '$SBORDER' jgctl color_sel_border '${COLOR_SEL_BORDER}' '$me')") +fi +out+=("^sep()") +out+=("Apply accent preset,^checkout(sel_accents)") + +out2+=("^tag(sel_accents)") +out2+=("^sep(Accent presets)") +while IFS="," read -r BG FG BGNAME FGNAME +do +[[ "$BGNAME" == "" ]] && BGNAME=${BG} +[[ "$FGNAME" == "" ]] && FGNAME=${FG} +out2+=(" $(printf '%*s' 25 "${FGNAME} on ${BGNAME}") ,jgctl accent '${BG}' '${FG}';$me") +out21+=(" $(printf '%*s' 25 "${BGNAME} on ${FGNAME}") ,jgctl accent '${FG}' '${BG}';$me") +done < <(tail -n +2 ~/.config/mabox/menu_accents.csv) +out2+=("${out21[@]}") # Item font submenu out2+=("^tag(mitemfont)") @@ -264,19 +466,16 @@ else cp /usr/share/mabox-colorizer/fonts.list ~/.config/mabox/ fi - if [ "${#favfonts[@]}" -gt 0 ];then - out2+=("^sep($FONT_FAMILY)") - for fon in "${favfonts[@]}";do - [[ "$menu_font_family" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_font_family='${fon}'\";$me") - done - fi - out2+=("^sep()") - out2+=(" Edit favorited fonts list,geany ~/.config/mabox/fonts.list") - +if [ "${#favfonts[@]}" -gt 0 ];then + out2+=("^sep($FONT_FAMILY)") + for fon in "${favfonts[@]}";do + [[ "$menu_font_family" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_font_family='${fon}'\";$me") + done +fi out+=("^sep($SEPARATOR_TITLE)") -out+=("󰛖 $FONT [ $menu_sep_font_family $menu_sep_font_size ],^checkout(mtitlefont)") + out2+=("^tag(mtitlefont)") out2+=("^sep($TITLE_FONT)") @@ -293,17 +492,12 @@ for i in "${sizes[@]}" done if [ "${#favfonts[@]}" -gt 0 ];then - out2+=("^sep($FONT_FAMILY)") - for fon in "${favfonts[@]}";do - [[ "$menu_sep_font_family" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_sep_font_family='${fon}'\";$me") - done - fi - out2+=("^sep()") - out2+=(" Edit favorited fonts list,geany ~/.config/mabox/fonts.list") - - - - + out2+=("^sep($FONT_FAMILY)") + for fon in "${favfonts[@]}";do + [[ "$menu_sep_font_family" == "$fon" ]] && out2+=(" ${fon},$me") || out2+=(" ${fon},mb-setvar \"menu_sep_font_family='${fon}'\";$me") + done +fi + out+=("$(printf '%3s' "$TBGA") $COLOR_TITLE_BG,^pipe(mbclr '$TBG' jgctl color_title_bg '${COLOR_TITLE_BG}' '$me')") out+=("$(printf '%3s' "$TFGA") AbCd $COLOR_TITLE_FG,^pipe(mbclr '$TFG' jgctl color_title_fg '${COLOR_TITLE_FG}' '$me')") out+=("$(printf '%3s' "$TBORDERA") $COLOR_TITLE_BORDER,^pipe(mbclr '$TBORDER' jgctl color_title_border '${COLOR_TITLE_BORDER}' '$me')") @@ -315,13 +509,22 @@ case "$SEPHALIGN" in right) icon="";; esac -out+=("$icon $SEP_HALIGN [ $SEPHALIGN ],^checkout(sephalign)") +out+=("$icon $SEP_HALIGN [ $SEPHALIGN ],^checkout(sephalign)") out+=("^sep()") out+=("$(printf '%3s' "$SEPFGA") ------ ${COLOR_SEP_FG},^pipe(mbclr '$SEPFG' jgctl color_sep_fg '${COLOR_SEP_FG}' '$me')") + +out+=("^sep($FONTS)") +out+=("󰛖 $TITLE [ $menu_sep_font_family $menu_sep_font_size ],^checkout(mtitlefont)") +out+=("󰛖 $ITEM [ $menu_font_family $menu_font_size ],^checkout(mitemfont)") + + + + + out2+=("^tag(gradientpos)") out2+=("^sep($GRADIENT_POS $GRADIENT)") -out2+=("$NONE,jgctl menu_gradient_pos none;$me") +out2+=("󰄱 $NONE,jgctl menu_gradient_pos none;$me") out2+=("^sep()") out2+=(" $TOP,jgctl menu_gradient_pos top;$me") out2+=(" $RIGHT,jgctl menu_gradient_pos right;$me") @@ -334,39 +537,32 @@ out2+=(" $BOTTOM_RIGHT,jgctl menu_gradient_pos bottom_right;$me") out2+=("^tag(sephalign)") out2+=("^sep($SEP_HALIGN)") -out2+=(" $H_LEFT,jgctl sep_halign left;$me") -out2+=(" $H_CENTER,jgctl sep_halign center;$me") -out2+=(" $H_RIGHT,jgctl sep_halign right;$me") -out2+=("^tag(itemborder)") +[[ "$SEPHALIGN" == "left" ]] && out2+=("  $H_LEFT,jgctl sep_halign left;$me") || out2+=("  $H_LEFT,jgctl sep_halign left;$me") +[[ "$SEPHALIGN" == "center" ]] && out2+=("  $H_CENTER,jgctl sep_halign center;$me") || out2+=("  $H_CENTER,jgctl sep_halign center;$me") +[[ "$SEPHALIGN" == "right" ]] && out2+=("  $H_RIGHT,jgctl sep_halign right;$me") || out2+=("  $H_RIGHT,jgctl sep_halign right;$me") +out2+=("^tag(itemborder_radius)") out2+=("^sep($ITEM_BORDER)") -out2+=("0,jgctl item_border 0;$me") +[[ "$IBORDER" == 0 ]] && out2+=(" 0 px,jgctl item_border 0;$me") || out2+=(" 0 px,jgctl item_border 0;$me") out2+=("^sep()") -out2+=("1,jgctl item_border 1;$me") -out2+=("2,jgctl item_border 2;$me") -out2+=("^tag(itemradius)") -out2+=("^sep($ITEM_RADIUS)") -out2+=("0,jgctl item_radius 0;$me") -out2+=("^sep()") -out2+=("1,jgctl item_radius 1;$me") -out2+=("2,jgctl item_radius 2;$me") -out2+=("3,jgctl item_radius 3;$me") -out2+=("4,jgctl item_radius 4;$me") -out2+=("5,jgctl item_radius 5;$me") -out2+=("6,jgctl item_radius 6;$me") +[[ "$IBORDER" == 1 ]] && out2+=(" 1 px,jgctl item_border 1;$me") || out2+=(" 1 px,jgctl item_border 1;$me") +[[ "$IBORDER" == 2 ]] && out2+=(" 2 px,jgctl item_border 2;$me") || out2+=(" 2 px,jgctl item_border 2;$me") + +out2+=("^sep($ITEM_RADIUS)") +[[ "$IRADIUS" == 0 ]] && out2+=(" 0 px,jgctl item_radius 0;$me") || out2+=(" 0 px,jgctl item_radius 0;$me") +out2+=("^sep()") +[[ "$IRADIUS" == 1 ]] && out2+=(" 1 px,jgctl item_radius 1;$me") || out2+=(" 1 px,jgctl item_radius 1;$me") +[[ "$IRADIUS" == 2 ]] && out2+=(" 2 px,jgctl item_radius 2;$me") || out2+=(" 2 px,jgctl item_radius 2;$me") +[[ "$IRADIUS" == 3 ]] && out2+=(" 3 px,jgctl item_radius 3;$me") || out2+=(" 3 px,jgctl item_radius 3;$me") +[[ "$IRADIUS" == 4 ]] && out2+=(" 4 px,jgctl item_radius 4;$me") || out2+=(" 4 px,jgctl item_radius 4;$me") +[[ "$IRADIUS" == 5 ]] && out2+=(" 5 px,jgctl item_radius 5;$me") || out2+=(" 5 px,jgctl item_radius 5;$me") +[[ "$IRADIUS" == 6 ]] && out2+=(" 6 px,jgctl item_radius 6;$me") || out2+=(" 6 px,jgctl item_radius 6;$me") -out+=("^sep($GENERATEFROMWP)") -out+=("$LIGHTBG,w2theme menu light;$me") -out+=("$DARKBG,w2theme menu dark;$me") out+=("^sep($MORE_MENU_SETTINGS)") out+=(" $GLOBAL_MENU_SETTINGS,jgmenusettings-pipe -c") #out+=("$GLOBAL_MENU_SETTINGS,^pipe(jgmenusettings-pipe -r)") -out+=("^sep()") -if [ -f "${THEMERC}.bak" ]; then - out+=("󰁯 $RESET ${jgmenu_theme} $TO_DEFAULT,jgctl reset;$me") -fi -out+=(" $EDIT ${jgmenu_theme} $FILE,xdg-open $THEMERC") + ### 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") @@ -380,7 +576,7 @@ if [[ "$1" == "-s" ]]; then source "$CNF_FILE" out+=("^sep()") - out+=(" ⮜⮜⮜ Colorizer,colorizer -s") + out+=(" ${arrow_string_left} Colorizer,colorizer -s") if [[ "$colorizer_size" == "full" ]];then eval $(xdotool getdisplaygeometry --shell) @@ -400,8 +596,8 @@ if [[ "$1" == "-s" ]]; then [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius [ -z $jgmenu_use_borders ] && menu_border=0 -JGWIDTH=$((jgtools_padding + 278 + jgtools_padding)) - MENU_PADDING_TOP=$((jgtools_padding + 158)) +JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) + MENU_PADDING_TOP=$((jgtools_padding + 150)) #WALLPAPER read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) THUMBDIR="$HOME/.cache/colorizer/thumbs" @@ -421,14 +617,15 @@ JGWIDTH=$((jgtools_padding + 278 + jgtools_padding)) mkconfigfile cat < ${MENU_ITEMS} -@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,${THUMB} +@icon,,$((jgtools_padding )),$((jgtools_padding)),270,150,4,left,top,,,${THUMB} -@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 120)),270,30,0,left,top,#222222 20,#222222 70, -@text,,$((jgtools_padding + 158)),$((jgtools_padding + 120)),120,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer Menus -@rect,,$((jgtools_padding + 14)),$((jgtools_padding + 22)),35,80,2,left,top,${MBORDER} ${MBORDERA},${MBG} ${MBGA}, -@rect,,$((jgtools_padding + 50)),$((jgtools_padding + 72)),35,60,2,left,top,${MBORDER} ${MBORDERA},${MBG} ${MBGA}, +@rect,,$((jgtools_padding)),$((jgtools_padding + 116)),270,30,0,left,top,#222222 20,#222222 70, +@text,,$((jgtools_padding + 158)),$((jgtools_padding + 116)),120,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer Menus +@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 22)),35,80,2,left,top,${MBORDER} ${MBORDERA},${MBG} ${MBGA}, +@rect,,$((jgtools_padding + 40)),$((jgtools_padding + 72)),35,60,2,left,top,${MBORDER} ${MBORDERA},${MBG} ${MBGA}, $(printf '%s\n' "${out[@]}") $(printf '%s\n' "${out2[@]}") +$(printf '%s\n' "${out3[@]}") EOF jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null @@ -436,3 +633,4 @@ EOF fi printf '%s\n' "${out[@]}" printf '%s\n' "${out2[@]}" +printf '%s\n' "${out3[@]}" diff --git a/bin/colorizer-ob b/bin/colorizer-ob index 00a996b..3aaa841 100755 --- a/bin/colorizer-ob +++ b/bin/colorizer-ob @@ -509,7 +509,7 @@ if [[ "$1" == "-s" ]]; then source $HOME/.config/colorizer/colorizer.conf out+=("^sep()") -out+=(" ⮜⮜⮜ Colorizer,colorizer -s") +out+=(" ${arrow_string_left} Colorizer,colorizer -s") if [[ "$colorizer_size" == "full" ]];then @@ -530,8 +530,8 @@ JGWIDTH=40 [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius [ -z $jgmenu_use_borders ] && menu_border=0 -JGWIDTH=$((jgtools_padding + 278 + jgtools_padding)) - MENU_PADDING_TOP=$((jgtools_padding + 158)) +JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) + MENU_PADDING_TOP=$((jgtools_padding + 150)) # WALLPAPER IMAGE read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) @@ -552,10 +552,10 @@ fi mkconfigfile cat < ${MENU_ITEMS} -@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,${THUMB} -@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-ob.png -@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 128)),270,22,0,left,top,#222222 20,#222222 70, -@text,,$((jgtools_padding + 138)),$((jgtools_padding + 124)),130,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer Openbox +@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB} +@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-ob.png +@rect,,$((jgtools_padding)),$((jgtools_padding + 124)),270,22,0,left,top,#222222 20,#222222 70, +@text,,$((jgtools_padding + 138)),$((jgtools_padding + 120)),130,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer Openbox $(printf '%s\n' "${out[@]}") $(printf '%s\n' "${out2[@]}") EOF diff --git a/bin/colorizer-pyradio b/bin/colorizer-pyradio index a840e31..6a7242b 100755 --- a/bin/colorizer-pyradio +++ b/bin/colorizer-pyradio @@ -111,7 +111,8 @@ read MB1 MB2 MBFG<<< "$(grep '^Messages Border ' ${THEMERC})" if pgrep -f "/usr/bin/python /usr/bin/pyradio" >/dev/null ;then : else - out+=("PYRADIO W + r ,gtk-launch pyradio;sleep 1;$me") + out+=("$START_PYRADIO W + r ,xdotool key super+r;$me") + #out+=("PYRADIO W + r ,gtk-launch pyradio;sleep 1;$me") fi @@ -184,7 +185,7 @@ if [[ "$1" == "-s" ]]; then source "$CNF_FILE" out+=("^sep()") - out+=(" ⮜⮜⮜ Colorizer,colorizer -s") + out+=(" ${arrow_string_left} Colorizer,colorizer -s") if [[ "$colorizer_size" == "full" ]];then eval $(xdotool getdisplaygeometry --shell) @@ -203,8 +204,8 @@ if [[ "$1" == "-s" ]]; then [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius [ -z $jgmenu_use_borders ] && menu_border=0 - JGWIDTH=$((jgtools_padding + 278 + jgtools_padding)) - MENU_PADDING_TOP=$((jgtools_padding + 158)) + JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) + MENU_PADDING_TOP=$((jgtools_padding + 150)) #WALLPAPER read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) @@ -225,10 +226,10 @@ if [[ "$1" == "-s" ]]; then mkconfigfile cat < ${MENU_ITEMS} -@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,${THUMB} +@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB} #@icon,,$((jgtools_padding + 4)),$((jgtools_padding + 4)),270,150,4,left,top,,,/usr/share/mabox-colorizer/img/colorizer-conky.png -@rect,,$((jgtools_padding + 4)),$((jgtools_padding + 120)),270,34,0,left,top,#222222 20,#222222 70, -@text,,$((jgtools_padding + 148)),$((jgtools_padding + 124)),120,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer PyRadio +@rect,,$((jgtools_padding)),$((jgtools_padding + 116)),270,34,0,left,top,#222222 20,#222222 70, +@text,,$((jgtools_padding + 144)),$((jgtools_padding + 120)),120,30,0,left,top,#FFFFFF ,${WINCLR},Colorizer PyRadio $(printf '%s\n' "${out[@]}") diff --git a/bin/conkyctl b/bin/conkyctl index 6c16bb2..38b03cb 100755 --- a/bin/conkyctl +++ b/bin/conkyctl @@ -898,7 +898,7 @@ contextmenu () { out+=("^sep()") out+=("$EDIT_CUSTOMCOMMANDS,conkyctl cmdmenu_edit ${name}") out+=("^sep()") - out+=(" ⮜⮜⮜ Conky Manager (Colorizer),colorizer-conky -s") + out+=(" ${arrow_string_left} Conky Manager (Colorizer),colorizer-conky -s") if [[ "$CONKYCFG" =~ "mount_points" ]]; then out+=("^sep($MOUNTPOINTS)") diff --git a/bin/jgctl b/bin/jgctl index 4015efd..ded2e8d 100755 --- a/bin/jgctl +++ b/bin/jgctl @@ -233,8 +233,13 @@ color_sel_border () { sd "color_sel_border.*$" "color_sel_border = $SBORDER $1" ${THEMERC} ;; esac - read IBOR<<< "$(grep 'item_border' ${THEMERC} | cut -d'=' -f2)" - [[ ${IBOR} == "0" ]] && item_border 1 + #read IBOR<<< "$(grep 'item_border' ${THEMERC} | cut -d'=' -f2)" + #[[ ${IBOR} == "0" ]] && item_border 1 +} +accent () { + color_sel_bg "${1}" + color_sel_fg "${2}" + color_sel_border "${2}" } tweak () { case "$1" in @@ -257,16 +262,22 @@ tweak () { opacity color_menu_bg "$2" opacity color_menu_bg_to "$2" ;; - padding) + sizing) case "$2" in tight) mb-setvar jgtools_padding=0 + mb-setvar jgtools_border=0 + mb-setvar submenu_spacing=1 ;; normal) mb-setvar jgtools_padding=8 + mb-setvar jgtools_border=0 + mb-setvar submenu_spacing=2 ;; wide) mb-setvar jgtools_padding=20 + mb-setvar jgtools_border=4 + mb-setvar submenu_spacing=4 ;; esac ;; @@ -281,6 +292,52 @@ opacity () { sd "$1 .*= $COLOR.*$" "$FUNC = $COLOR $2 $REST" ${THEMERC} } +savescheme () { + # ask for scheme name + schemename=$(yad --center --width=300 --title "SAVE_AS" --entry --entry-label="LABEL" --entry-text="NAME") || exit 1 + + echo "${1}${schemename}" >> "$HOME/.config/colorizer/menus/userschemes.csv" + #echo "${1}" + +} +applyscheme () { +line=$(awk 'NR == n' n=$1 "$HOME/.config/colorizer/menus/userschemes.csv") +#notify-send.sh "$1" "${line}" +case "$1" in + sys) SCHEMEFILE="/usr/share/mabox-colorizer/colorschemes/menus.csv";; + usr) SCHEMEFILE="$HOME/.config/colorizer/menus/userschemes.csv";; +esac + +while IFS="|" read -r mbg mbgt mborder tbg tfg tborder normbg nfg sbg sfg sborder sepfg grad scheme_name +do +mb-setvar jgmenu_theme=MBcolors +color_menu_bg "${mbg}" +color_menu_bg_to "${mbgt}" +color_menu_border "${mborder}" +color_title_bg "${tbg}" +color_title_fg "${tfg}" +color_title_border "${tborder}" +color_norm_bg "${normbg}" +color_norm_fg "${nfg}" +color_sel_bg "${sbg}" +color_sel_fg "${sfg}" +color_sel_border "${sborder}" +color_sep_fg "${sepfg}" +menu_gradient_pos "${grad}" + +item_border 0 +color_title_bg 100 +color_menu_bg 100 +color_menu_bg_to 100 +color_norm_bg 0 + +#notify-send.sh "${scheme_name}" "${mbg}" +done < <(awk 'NR == n' n=$2 "$SCHEMEFILE") +} + +delscheme() { + sed -i ${1}d "$HOME/.config/colorizer/menus/userschemes.csv" +} case "$1" in theme) theme "$2";; reset) reset ;; @@ -302,7 +359,11 @@ case "$1" in color_sel_bg) color_sel_bg "$2";; color_sel_fg) color_sel_fg "$2";; color_sel_border) color_sel_border "$2";; + accent) accent "$2" "$3";; tweak) tweak "$2" "$3";; opacity) opacity "$2" "$3";; + savescheme) savescheme "$2";; + applyscheme) applyscheme "$2" "$3";; + delscheme) delscheme "$2";; *) : ;; esac diff --git a/bin/transparent-cava b/bin/transparent-cava new file mode 100755 index 0000000..e1f2776 --- /dev/null +++ b/bin/transparent-cava @@ -0,0 +1,45 @@ +#!/bin/bash +#: Usage: transparent-cava (height in pixels) (width full or half) +#: example transparent-cava 100 full +#: default is 200px height and half width + +CONFIG_DIR="$HOME/.config/terminator" +CONFIG_FILE="$CONFIG_DIR/cava-transparent" +if [ ! -f $CONFIG_FILE ]; then +cat < ${CONFIG_FILE} +[global_config] + dbus = False +[keybindings] +[profiles] + [[default]] + allow_bold = False + background_darkness = 0.0 + background_type = transparent + cursor_blink = False + cursor_color = "#aaaaaa" + font = Sans 4 + show_titlebar = False + scrollbar_position = hidden + scroll_on_keystroke = False + use_custom_command = True + custom_command = cava + use_system_font = False +[layouts] +[plugins] +EOF +fi + +CAVA_HEIGHT=${1:-200} +CAVA_WIDTH=${2:-half} +WIDTH=$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f1) +HEIGHT=$(wmctrl -d|grep "*"|awk '{print $4}'|cut -d'x' -f2) +TOP=$((HEIGHT-CAVA_HEIGHT)) +LEFT=0 +if [ "$CAVA_WIDTH" != "full" ];then +LEFT=$((WIDTH/4)) +WIDTH=$((WIDTH/2)) +else +: +fi + +terminator -b -g "${CONFIG_FILE}" -T cavatransparent --geometry "${WIDTH}x${CAVA_HEIGHT}+${LEFT}+${TOP}" -i amarok_playcount diff --git a/share/mabox-colorizer/colorschemes/menus.csv b/share/mabox-colorizer/colorschemes/menus.csv new file mode 100644 index 0000000..6b51a80 --- /dev/null +++ b/share/mabox-colorizer/colorschemes/menus.csv @@ -0,0 +1,4 @@ + MBG | MBGT |MBORDER| TBG | TFG |TBORDER|NORMBG | NFG | SBG | SFG |SBORDER| SEPFG |GRADIENT|scheme_name +#383838|#222222|#eeeeee|#325a52|#d3d4bf|#579c8e|#2b303b|#dadada|#579c8e|#ffffff|#579c8e|#4f4f4f|none|Istredd +#1E1E1E|#262626|#333333|#383838|#BBBBBB|#222222|#1e1e1e|#9b9b9b|#000000|#FFCC66|#FFCC66|#363636|right|Jaskier +#d3d4bf|#d2cda1|#cdc76d|#cdc76d|#0c1d23|#c6b76b|#d3d4bf|#0c1d23|#a29d62|#060b0a|#c6b76b|#a29d62|top_right|Jaskier Light