diff --git a/usr/bin/jgdesktops b/usr/bin/jgdesktops index 30285dd..847e37b 100755 --- a/usr/bin/jgdesktops +++ b/usr/bin/jgdesktops @@ -7,7 +7,7 @@ me="jgdesktops -s" case $LANG in pl*) - TITLE="Pulpity i Okna" + TITLE="Pulpity i Okna" REMOVE="Usuń to menu z panelu" ACTIVE="bieżący" GOTO="Idź do..." @@ -22,7 +22,7 @@ case $LANG in CONKY_TOGGLE="Włącz/Wyłącz Conky" PICOM_TOGGLE="Włącz/Wyłącz Picom" DESKMNGR="Menadżer sesji pulpitowych" - WALLCHANGER="Tapeta" + WALLCHANGER="Tapetu oraz stylizacja pulpitu" DESKGRID="Desktop Grid" SCREEN_RES="Ustawienia ekranu" ENABLE="Włącz" @@ -42,10 +42,10 @@ case $LANG in WALLPAPER="Tapeta" TOOLS="Narzędzia" OBTHEME="Motyw Openbox" - MENUPANELS="Menu i Panele" - YES="Tak" - NO="Nie" - ;; + MENUPANELS="Menu i Panele" + YES="Tak" + NO="Nie" + ;; es*) TITLE="Windows & Desktops" REMOVE="Eliminar este menú del panel" @@ -62,7 +62,7 @@ case $LANG in CONKY_TOGGLE="Conky Toggle" PICOM_TOGGLE="Picom Toggle" DESKMNGR="Desktop session Manager" - WALLCHANGER="Wallpaper" + WALLCHANGER="Wallpaper & Desktop styling" DESKGRID="Desktop Grid" SCREEN_RES="Screen Settings" ENABLE="Enable" @@ -82,12 +82,12 @@ case $LANG in WALLPAPER="Wallpaper" TOOLS="Tools" OBTHEME="Openbox Theme" - MENUPANELS="Menus/Panels" - YES="Yes" - NO="No" + MENUPANELS="Menus/Panels" + YES="Yes" + NO="No" ;; - *) - TITLE="Windows & Desktops" + *) + TITLE="Windows & Desktops" REMOVE="Remove this menu from panel" ACTIVE="active" GOTO="Go to..." @@ -102,7 +102,7 @@ case $LANG in DESKMNGR="Desktop session Manager" CONKY_TOGGLE="Conky Toggle" PICOM_TOGGLE="Picom Toggle" - WALLCHANGER="Wallpaper" + WALLCHANGER="Wallpaper & Desktop styling" DESKGRID="Desktop Grid" SCREEN_RES="Screen settings" ENABLE="Enable" @@ -123,9 +123,9 @@ case $LANG in TOOLS="Tools" COLORIZER_SETTINGS="Colorizer Settings" OBTHEME="Openbox Theme" - MENUPANELS="Menus/Panels" - YES="Yes" - NO="No" + MENUPANELS="Menus/Panels" + YES="Yes" + NO="No" ;; esac @@ -239,8 +239,8 @@ fi [[ "$focus" = "no" ]] && out+=("󰄱 $FOCUS,obxml focus_follow_mouse on") || out+=("󰄲 $FOCUS,obxml focus_follow_mouse off") out+=("^sep($TOOLS)") -out+=("󰸉 $WALLCHANGER,^pipe(jgwallpaperchanger)") -out+=("󱇙 SuperClick,^pipe(jgdeskgrid)") +out+=("󰸉 $WALLCHANGER,jgwallpaperchanger -s") +out+=("󱇙 SuperClick,jgdeskgrid -s") out+=(" $DESKMNGR,^pipe(jgdeskmngr)") diff --git a/usr/bin/jgmenusettings-pipe b/usr/bin/jgmenusettings-pipe index 7fbe613..9894eb6 100755 --- a/usr/bin/jgmenusettings-pipe +++ b/usr/bin/jgmenusettings-pipe @@ -323,13 +323,13 @@ out+=("󰛖 $TITLE_FONT [ $menu_sep_font_family $menu_sep_font_s out+=("$LINEHEIGHT [ $item_height_factor% ],^checkout(lineheight)") case $menu_font_family in - "Noto Sans Light") nol="";; - "Noto Sans Medium") nom="";; - Deja*) de="";; - Robo*) ro="";; - Inco*) in="";; - Ubunt*) ub="";; - *);; + "Noto Sans Light") nol="";; + "Noto Sans Medium") nom="";; + Deja*) de="";; + Robo*) ro="";; + Inco*) in="";; + Ubunt*) ub="";; + *);; esac out2+=("^tag(itemfont)") @@ -338,10 +338,10 @@ out2+=("󰛖 $FONT_CUSTOM,mb-setfont menu_item;$me") out2+=("^sep()") if [ -f "$HOME/.config/mabox/fonts.list" ];then - mapfile -t favfonts < <( grep -vE "^($|#)" ~/.config/mabox/fonts.list) + mapfile -t favfonts < <( grep -vE "^($|#)" ~/.config/mabox/fonts.list) else - mapfile -t favfonts < <( grep -vE "^($|#)" /usr/share/mabox-colorizer/fonts.list) - cp /usr/share/mabox-colorizer/fonts.list ~/.config/mabox/ + mapfile -t favfonts < <( grep -vE "^($|#)" /usr/share/mabox-colorizer/fonts.list) + cp /usr/share/mabox-colorizer/fonts.list ~/.config/mabox/ fi if [ "${#favfonts[@]}" -gt 0 ];then @@ -357,10 +357,10 @@ fi out2+=("󰧳 $DECREASE $((menu_font_size-1)) px,mb-setvar menu_font_size=$((menu_font_size-1));$me") out2+=("^sep()") sizes=(14 13 12 11 10 9 8) - for i in "${sizes[@]}" - do - [[ "$menu_font_size" == "$i" ]] && out2+=(" $i px,$me") || out2+=(" $i px,mb-setvar menu_font_size=$i;$me") - done + for i in "${sizes[@]}" + do + [[ "$menu_font_size" == "$i" ]] && out2+=(" $i px,$me") || out2+=(" $i px,mb-setvar menu_font_size=$i;$me") + done out2+=("^tag(titlefont)") @@ -381,10 +381,10 @@ if [ "${#favfonts[@]}" -gt 0 ];then out2+=("󰧳 $DECREASE $((menu_sep_font_size-1)) px,mb-setvar menu_sep_font_size=$((menu_sep_font_size-1));$me") out2+=("^sep()") sizes=(14 13 12 11 10 9 8) - for i in "${sizes[@]}" - do - [[ "$menu_sep_font_size" == "$i" ]] && out2+=(" $i px,$me") || out2+=(" $i px,mb-setvar menu_sep_font_size=$i;$me") - done + for i in "${sizes[@]}" + do + [[ "$menu_sep_font_size" == "$i" ]] && out2+=(" $i px,$me") || out2+=(" $i px,mb-setvar menu_sep_font_size=$i;$me") + done out2+=("^tag(lineheight)") for i in 160 180 200 240 280 300 400; do out2+=("$(printf "%4s%%,%s" "$i" "mb-setvar item_height_factor=${i};$me")");done @@ -392,42 +392,14 @@ out2+=("^tag(lineheight)") ########## THEMES out+=("^sep($COLOR_SCHEME)") -ob_file=$HOME/.config/openbox/rc.xml -[[ -f $ob_file ]] && wm_theme=$(awk '// {while (getline n) {if (match(n, //)){l=n; exit}}} END {split(l, a, "[<>]"); print a[3]}' "$ob_file") - - -if [ $jgmenu_theme != obtheme ]; then #INNY NIŻ OB THEME -. $HOME/.config/mabox/jgobthemes/${jgmenu_theme}.colorrc > /dev/null 2>&1 & -out+=("$CHOOSE [$jgmenu_theme],^checkout(motywy)") -out+=("$EDIT_CURRENT: ($jgmenu_theme),xdg-open $HOME/.config/mabox/jgobthemes/$jgmenu_theme.colorrc,geany") -out+=("$RANDTHEME,mb-setvar jgmenu_theme=$(basename -s .colorrc $(ls ~/.config/mabox/jgobthemes/*.colorrc | shuf -n 1));$me") -out+=("$FOLLOW_OB,mb-setvar jgmenu_theme=obtheme;$me -^sep()") -out+=("$GRADIENT [ ${menu_gradient_pos:-none} ],^checkout(gradient)") -out2+=("^tag(gradient)") -for i in none top right bottom left top_left top_right bottom_left bottom_right; do out2+=("$(printf "%14s,%s" "$i" "mb-setvar menu_gradient_pos=${i};$me")");done +out+=("$CHOOSE ,^checkout(motywy)") +out+=("$RANDTHEME,jgctl randomscheme;$me") out2+=("^tag(motywy)") -else -. $HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc > /dev/null 2>&1 & -out+=("#${menu_gradient_pos}\n") -out+=("$CHOOSE [${wm_theme// /_}],^checkout(motywy)") -out+=("$EDIT_CURRENT: (${wm_theme// /_}),xdg-open $HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc,geany") -out+=("$RANDTHEME,mb-setvar jgmenu_theme=$(basename -s .colorrc $(ls ~/.config/mabox/jgobthemes/*.colorrc | shuf -n 1));$me") -out+=("$FOLLOW_OB,mb-setvar jgmenu_theme=obtheme;$me -^sep()") -out+=("$GRADIENT [ ${menu_gradient_pos:-none} ],^checkout(gradient)") -out2+=("^tag(gradient)") -for i in none top right bottom left top_left top_right bottom_left bottom_right; do out2+=("$(printf "%14s,%s" "$i" "mb-setvar menu_gradient_pos=${i} $HOME/.config/mabox/jgobthemes/${wm_theme// /_}.colorrc;$me")");done -out2+=("^tag(motywy)") -fi - - - - -for item in "$HOME"/.config/mabox/jgobthemes/*colorrc; do +for item in /usr/share/mb-jgtools/jgobthemes/*colorrc; do theme="${item##*/}" - out2+=("${theme%.*},mb-setvar jgmenu_theme=${theme%.*};$me") + #notify-send.sh "th" "$item" + out2+=("${theme%.*},jgctl applyoldscheme ${item};$me") done ########## ICONS diff --git a/usr/bin/jgwallpaperchanger b/usr/bin/jgwallpaperchanger index 0e1b504..0081319 100755 --- a/usr/bin/jgwallpaperchanger +++ b/usr/bin/jgwallpaperchanger @@ -1,7 +1,6 @@ #!/bin/bash # jgwallpaperchanger - dynamic menu (or submenu) to configure/set wallpapers # -#TODO wallpaper colors on image #TODO quickly colorize OB,Conky,menus from wp-colors + apply predefined schemes if [[ $1 == "-r" || "$1" == "-d" ]];then @@ -14,6 +13,10 @@ CONFIG_DIR="$HOME/.config/mbwallpaper" CONF_FILE="$CONFIG_DIR/mbwallpaper.conf" WALLPAPERS_LIST="$CONFIG_DIR/wplist" +## SYSTEM AND USER SAVED THEMES +OB_SYSTHEMES="/usr/share/mabox-colorizer/colorschemes/ob.csv" +OB_USERTHEMES="$HOME/.config/colorizer/openbox/userthemes.csv" + # Make config directory if not exist mkdir -p $CONFIG_DIR @@ -34,7 +37,6 @@ source <(grep = $CONF_FILE) wallpaper_dir2=${wallpaper_dir/$HOME/\~} #notify-send.sh "Wallpaper Dir" "${wallpaper_dir}" - COLORIZER_CONF="$HOME/.config/colorizer/colorizer.conf" source ${COLORIZER_CONF} @@ -66,7 +68,7 @@ esac main(){ case $LANG in pl*) - _TITLE="Zmieniacz tapet" + _TITLE="Tapety oraz stylizacja pulpitu" _WALLPAPERS="Tapety" _RANDWALL="Losowa tapeta" _EDIT_WPDIRS="Edytuj katalogi z tapetami" @@ -94,7 +96,7 @@ case $LANG in _COLORIZER_PICOM="Kompozytor Picom" _COLORIZER_OB="Moduł Openbox" _COLORIZER_MENU="Moduł Menu" - _COLORIZER_CONKY="Moduł Conky" + _COLORIZER_CONKY="Menadżer Conky" _COLORIZER_PYRADIO="Moduł PyRadio" _COLORIZER_CAVA="Moduł Cava" _B_LC_ACTION="Akcja (lewy klik)" @@ -111,9 +113,30 @@ case $LANG in _PREVIEW_DESC="Podgląd użyj 󱦱 󱦰 Enter Esc " _COL_WINDOW_DESC="Colorizer - okno" _COL_MENU_DESC="Colorizer - dynamiczne menu" + + _GOBACK="powrót" + + SYSTEM_THEMES="Systemowe" + YOUR_THEMES="Moje motywy" + SAVE_CURRTHEME="Zapisz aktualną kobfigurację jako..." + OPEN_THEMEFILE="Odwórz plik z motywami w edytorze" + THEME="Motyw" + APPLY="Zastosuj" + APPLY_THEME="Pełny motyw (kolory, czcionki i rozmiar)" + APPLY_SCHEME="Tylko kolory" + DELETE="Usuń" + DELETE_THEME="Usuń motyw" + OBTHEME_LBL="Motyw OpenBox" + MONOCHROMATIC="Monochromatyczny" + CHOOSE_AND_PICK="Wybierz wariant i pobierz kolor..." + GENERATEFROMWP="Generuj z kolorów tapety..." + LIGHTBG=" Jasne tło" + DARKBG="Ciemne tło" + RANDOMIZE="Generuj losowo" + ;; *) - _TITLE="Wallpaper Menu" + _TITLE="Wallpaper & Desktop styling" _WALLPAPERS="Wallpapers" _RANDWALL="Random Wallpaper" _EDIT_WPDIRS="Edit Wallpaper dirs" @@ -135,15 +158,12 @@ case $LANG in _LEFTPANEL="Left panel" _OBTHEME="Openbox Theme" _MENUPANELS="Menus/Panels" + _COLORIZER_CONKY="Conky Manager" _COLORIZER_HELP="Main Window and Help" _COLORIZER_ROOT="Colorizer rootmenu" _COLORIZER_FONTS="Configure Fonts" _COLORIZER_PICOM="Compositor settings (Picom)" - _COLORIZER_OB="Openbox module" - _COLORIZER_MENU="Menus/SidePanels module" - _COLORIZER_CONKY="Conky module" - _COLORIZER_PYRADIO="PyRadio module" - _COLORIZER_CAVA="Cava module" + _B_LC_ACTION="left-click action" _P_B_LC_ACTION="Panel button left-click action" _RAND="random" @@ -158,6 +178,25 @@ case $LANG in _PREVIEW_DESC="Preview & set use 󱦱 󱦰 Enter Esc " _COL_WINDOW_DESC="Colorizer - window" _COL_MENU_DESC="Colorizer - dynamic menu" + + _GOBACK="go back" + + _CHANGE_THEME="Change theme" + _CLICK_TO_APPLY="click to apply" + SYSTEM_THEMES="System themes..." + YOUR_THEMES="Your themes..." + THEME="Theme" + _GENERATE="Generate..." + MONOCHROMATIC="Monochromatic (pick color)" + CHOOSE_AND_PICK="Choose variant and pick color..." + GENERATEFROMWP="...from wallpaper colors..." + LIGHTBG="light variant" + DARKBG="dark variant" + RANDOMIZE="Random" + _MORE_OPTIONS="need more options?" + _COLOR_TUNING="color tuning?" + _SAVE_OWN="save/delete own themes?" + _USE="use..." ;; esac @@ -167,7 +206,7 @@ esac help="\nBased on idea of Mabox forum member Shwaybo.\n\nchange wallpapers from a directory, never using the same picture twice until all the pictures have been shown, and rotating x number of seconds (configurable) before the next wallpaper change.\n" -#out+=("^sep($TITLE)") +out+=("^sep($_WALLPAPERS)") [[ "$1" == "-s" || "$1" == "ipc" ]] && : || out+=("^sep($_WALLPAPERS)") if ! pgrep -f "mbwallpaper -s" > /dev/null; then #out+=("$NITROGEN,nitrogen") @@ -226,6 +265,167 @@ out2+=("^tag(interval)") out2+=("^sep($_INTERVAL)") for i in 3 5 10 30 60 120 300 600 1800 3600; do out2+=("$(printf " %4s,%s" "$i" "mb-setvar interval=${i} $CONF_FILE;$me")");done + #WALLPAPER and wallpaper colors + WALLPALDIR="$HOME/.cache/colorizer/palettes" + read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | cut -d'=' -f2) + THUMBDIR="$HOME/.cache/colorizer/thumbs" + mkdir -p ${THUMBDIR} + NAME=${WALLPATH////_} + if [[ "${NAME}" =~ ^_home_.* ]]; then + n=${#HOME} + ((n++)) + NAME=${NAME:${n}} + fi + THUMB="${THUMBDIR}/${NAME}.png" + if [[ ! -f "$THUMB" ]] + then + magick convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB} + fi + # wp colors + 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" + if [[ "${#w[@]}" -lt 8 ]]; then + w+=("#2e3440" "#4c566a" "#5e81ac" "#bf616b" "#b48ead" "#a3be8c" "#ebcb8b" "#d8dee9" "#eceff4") + fi + +### STYLES +out+=("^sep(Desktop styling)") +out+=(" OpenBox Windows Decoration,^root(obox)") +out+=(" Mabox Menus,^root(jgmenus)") +out+=(" Conky widgets,^root(conky)") + +case "$2" in + obox)option="--checkout=obox";; + jgmenus)option="--checkout=jgmenus";; + conky)option="--checkout=conky";; + *)option="";; +esac + +## OPENBOX +out1+=("^tag(obox)") +out1+=("^sep(OpenBox Window Decorations)") +out1+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()") + +out1+=("^sep($SYSTEM_THEMES)" "^sep()") +n=1 +while IFS="|" read -r abg abgto afg aline nbg nbgto nfg nline grad txtjust pheight pwidth handle bord bevel buttons fsize fname ndslimc weight slant scheme_name +do +((n=n+1)) +out1+=(" $(printf '%-20s' "${scheme_name}") in ,obtctl applytheme sys ${n};$me obox" "^sep()") +done < <(tail -n +2 "$OB_SYSTHEMES") +out1+=("^sep($YOUR_THEMES)" "^sep()") +n=1 +while IFS="|" read -r abg abgto afg aline nbg nbgto nfg nline grad txtjust pheight pwidth handle bord bevel buttons fsize fname ndslimc weight slant scheme_name +do +((n=n+1)) +out1+=(" $(printf '%-20s' "${scheme_name}") in ,obtctl applytheme usr ${n};$me obox" "^sep()") +done < <(tail -n +2 "$OB_USERTHEMES") + +out1+=("^sep($_GENERATE)") +out1+=(" $RANDOMIZE,obtctl randomizer;$me obox") +out1+=(" $MONOCHROMATIC,^checkout(monoch)") +out2+=("^tag(monoch)") +out2+=("^sep($CHOOSE_AND_PICK)") +out2+=(" $LIGHTBG...,obtctl mono pick light stylemenu") +out2+=(" $DARKBG...,obtctl mono pick dark stylemenu") +out1+=("^sep($GENERATEFROMWP)" "^sep()") +out1+=(" $LIGHTBG ,w2theme ob light;$me obox" "^sep()") +out1+=(" $DARKBG ,w2theme ob dark;$me obox") +out1+=("^sep()") + +out1+=("^sep($_MORE_OPTIONS)") +out1+=("^sep($_COLOR_TUNING)" "^sep($_SAVE_OWN)") +out1+=("$_USE Colorizer OpenBox,colorizer-ob -s") +out1+=("^sep()") +out1+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()") + + +## JGMENUS +MENU_SYSSCHEMES="/usr/share/mabox-colorizer/colorschemes/menus.csv" +MENU_USERSCHEMES="$HOME/.config/colorizer/menus/userschemes2.csv" +JG_SYS_AMOUNT=$(cat $MENU_SYSSCHEMES |wc -l) +JG_USR_AMOUNT=$(cat $MENU_USERSCHEMES |wc -l) +out1+=("^tag(jgmenus)") +out1+=("^sep(Menu/Panels)") +out1+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()") +out1+=("^sep($_CHANGE_THEME)") +out1+=(" $SYSTEM_THEMES ($((JG_SYS_AMOUNT-1))),^checkout(jg_sys)") +out2+=("^tag(jg_sys)") +out2+=("^sep($_CLICK_TO_APPLY)") + +n=1 + while IFS="|" read -r mbg mbga mbgt mbgta mborder mbordera tbg tbga tfg tfga tborder tbordera normbg normbga nfg nfga sbg sbga sfg sfga sborder sbordera sepfg sepfga b r p ss ibor irad a al sephal 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 '%-18s' "${scheme_name}") title [ sel ] ${icon} ,jgctl applyscheme sys $n;$me jgmenus" "^sep()") + done < <(tail -n +2 "$MENU_SYSSCHEMES") + +out1+=(" $YOUR_THEMES ($((JG_USR_AMOUNT-1))),^checkout(jg_usr)") +out2+=("^tag(jg_usr)") +out2+=("^sep($_CLICK_TO_APPLY)") + n=1 + while IFS="|" read -r mbg mbga mbgt mbgta mborder mbordera tbg tbga tfg tfga tborder tbordera normbg normbga nfg nfga sbg sbga sfg sfga sborder sbordera sepfg sepfga b r p ss ibor irad a al sephal 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 '%-18s' "${scheme_name}") title [ sel ] ${icon} ,jgctl applyscheme usr ${n};$me jgmenus" "^sep()") + done < <(tail -n +2 "$MENU_USERSCHEMES") + + out1+=("^sep($_GENERATE)") + out1+=(" $RANDOMIZE,jgctl randomscheme;$me jgmenus") + out1+=(" $MONOCHROMATIC,^checkout(monoch_menu)") + out2+=("^tag(monoch_menu)") + out2+=("^sep($CHOOSE_AND_PICK)") + out2+=(" $LIGHTBG...,jgctl mono pick light stylemenu") + out2+=(" $DARKBG...,jgctl mono pick dark stylemenu") + out1+=("^sep($GENERATEFROMWP)") + out1+=(" $LIGHTBG,w2theme menu light;$me jgmenus") + out1+=(" $DARKBG,w2theme menu dark;$me jgmenus") + +out1+=("^sep($_MORE_OPTIONS)") +out1+=("^sep($_COLOR_TUNING)" "^sep($_SAVE_OWN)") +out1+=("$_USE Colorizer Menu module,colorizer-menus -s") +out1+=("^sep()") + +out1+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()") + + +## CONKIES +out1+=("^tag(conky)") +out1+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()") +out1+=("^sep(Conky)") +out1+=("^sep(not implemented yet)") +out1+=("$_COLORIZER_CONKY,colorizer-conky -s") +out1+=("^sep()") +out1+=("${arrow_string_left} ${arrow_string_left} ${arrow_string_left} $_GOBACK,^back()") + +out+=("^sep()") +out+=(" $_COLORIZER_FONTS,colorizer-fonts -s") +out+=("^sep()") +out+=(" $_COLORIZER_PICOM,jgpicom-pipe -s") ### RUN @@ -242,17 +442,7 @@ case "$1" in out+=("^sep(Mabox Colorizer)") out+=("$_COLORIZER_HELP,ycolorizer") out+=("$_COLORIZER_ROOT,colorizer -s") - out+=("^sep()") - out+=("$_COLORIZER_FONTS,colorizer-fonts -s") - out+=("^sep()") - out+=("$_COLORIZER_PICOM,jgpicom-pipe -s") - out+=("^sep()") - out+=("$_COLORIZER_OB,colorizer-ob -s") - out+=("$_COLORIZER_MENU,colorizer-menus -s") - out+=("$_COLORIZER_CONKY,colorizer-conky -s") - out+=("^sep()") - out+=("$_COLORIZER_PYRADIO,colorizer-pyradio -s") - out+=("$_COLORIZER_CAVA,colorizer-cava -s") + out+=("^sep()") @@ -301,39 +491,44 @@ menu_margin_x=${submenu_spacing:-0} [ -z $jgmenu_use_borders ] && menu_border=0 JGWIDTH=$((jgtools_padding + 270 + jgtools_padding)) MENU_PADDING_TOP=$((jgtools_padding + 150)) - #WALLPAPER - read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | tail -1 | cut -d'=' -f2) - THUMBDIR="$HOME/.cache/colorizer/thumbs" - mkdir -p ${THUMBDIR} - NAME=${WALLPATH////_} - if [[ "${NAME}" =~ ^_home_.* ]]; then - n=${#HOME} - ((n++)) - NAME=${NAME:${n}} - fi - THUMB="${THUMBDIR}/${NAME}.png" - if [[ ! -f "$THUMB" ]] - then - magick convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB} + + # colors on image + n=0 + m=0 + X=$((jgtools_padding + 6)) + Y=$((jgtools_padding + 102)) + for i in "${w[@]}" + do + if [[ "$n" -lt "13" ]];then + dots+=("@rect,,$((X + 20*n)),$((Y)),18,18,1,left,top,#FFFFFF 80,${i} 100,") + else + dots+=("@rect,,$((X + 20*m)),$((Y+20)),18,18,1,left,top,#FFFFFF 80,${i} 100,") + ((m=m+1)) fi + ((n=n+1)) + done + + #TEMP POSITION: MENU_VALIGN="top" MENU_MARGIN_Y="80" mkconfigfile +echo menu_height_mode=dynamic >> ${CONFIG_FILE} cat < ${MENU_ITEMS} @icon,,$((jgtools_padding )),$((jgtools_padding)),270,150,4,left,top,,,${THUMB} -@rect,,$((jgtools_padding)),$((jgtools_padding + 119)),270,28,0,left,top,#222222 20,#222222 70, -@text,,$((jgtools_padding + 6)),$((jgtools_padding + 100)),100,28,0,left,top,#DDDDDD 60,${WINCLR}, -@text,,$((jgtools_padding + 84)),$((jgtools_padding + 119)),150,28,0,left,top,#FFFFFF ,${WINCLR},$_TITLE - +@rect,,$((jgtools_padding)),$((jgtools_padding + 96)),270,52,0,left,top,#222222 20,#222222 70, +@text,,$((jgtools_padding + 196)),$((jgtools_padding + 22)),100,28,0,left,top,#222222 30,${WINCLR}, +@text,,$((jgtools_padding + 194)),$((jgtools_padding + 20)),100,28,0,left,top,#FFFFFF 45,${WINCLR}, +@text,,$((jgtools_padding + 74)),$((jgtools_padding + 119)),180,28,0,left,top,#FFFFFF ,${WINCLR},$_TITLE +$(printf '%s\n' "${dots[@]}") $(printf '%s\n' "${out[@]}") $(printf '%s\n' "${out1[@]}") $(printf '%s\n' "${out2[@]}") EOF -jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} 2>/dev/null +jgmenu --config-file=${CONFIG_FILE} --csv-file=${MENU_ITEMS} ${option} 2>/dev/null exit 0 fi printf '%s\n' "${out[@]}"