From dfc7192e8ab5516af142a857d419428fd2fedbda Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Mon, 25 Sep 2023 13:37:33 +0200 Subject: [PATCH] small improvements --- bin/colorizer | 19 +++++++++++-------- bin/colorizer-ob | 7 ++++++- bin/obtctl | 25 +++++++++++++++++++------ 3 files changed, 36 insertions(+), 15 deletions(-) diff --git a/bin/colorizer b/bin/colorizer index c2f5435..9472939 100755 --- a/bin/colorizer +++ b/bin/colorizer @@ -293,14 +293,6 @@ mint+=("#6cabcd" "#5b73c4" "#aa876a" "#9d9d9d" "#db9d61" "#c76199" "#8c6ec9" "#c out+=("^sep(Mabox Colorizer)") -out+=(" $SETTINGS,^checkout(settings)") -LNG=${LANG:0:2} -if [[ -f "/usr/share/mabox-colorizer/help/$LNG.html" ]];then -out+=(" $HELP,yhtml /usr/share/mabox-colorizer/help/$LNG.html 'Mabox Colorizer'") -else -out+=(" $HELP,yhtml /usr/share/mabox-colorizer/help/en.html 'Mabox Colorizer'") -fi -out+=("^sep()") out+=(" $COLORIZE,^pipe(randomizer c)") out+=("^sep($MODULES)") out+=(" $FONTS,colorizer-fonts -s") @@ -523,6 +515,8 @@ out2+=("$i ,w2the fi done + + ### TODO Rework below as submenu(edit palette and present palette with HTML helper- to keep it on desktop, allowing to copy colors from it) ##out+=("^sep()") @@ -548,6 +542,15 @@ if [[ "$gradient_obtheme" == "yes" || "$gradient_menu" == "yes" ]];then out+=(" $PRE_GRADIENTS,^pipe(mbgrad)") fi +out+=("^sep($SETTINGS)") +out+=(" $SETTINGS,^checkout(settings)") +LNG=${LANG:0:2} +if [[ -f "/usr/share/mabox-colorizer/help/$LNG.html" ]];then +out+=(" $HELP,yhtml /usr/share/mabox-colorizer/help/$LNG.html 'Mabox Colorizer'") +else +out+=(" $HELP,yhtml /usr/share/mabox-colorizer/help/en.html 'Mabox Colorizer'") +fi + ### RESET ACTIONS (replaced by Randomizer) #out+=("^sep($RESET_COLORS)") #out+=("$RESET_CHOOSE,^checkout(resetroot)") diff --git a/bin/colorizer-ob b/bin/colorizer-ob index 3fda9f2..6b60f1d 100755 --- a/bin/colorizer-ob +++ b/bin/colorizer-ob @@ -74,6 +74,7 @@ case "$LANG" in GENERATEFROMWP="Generuj z kolorów tapety..." LIGHTBG=" Jasne tło" DARKBG="Ciemne tło" + RANDOMIZE="Generuj losowo" TITLEBAR="Pasek tytułowy" ACTIVE_WINDOW="Aktywne okno" INACTIVE_WINDOW="Nieaktywne okno" @@ -156,6 +157,7 @@ case "$LANG" in GENERATEFROMWP="Generate from wallpaper colors..." LIGHTBG="Light Background" DARKBG="Dark Background" + RANDOMIZE="Generate randomly" TITLEBAR="Title Bar" ACTIVE_WINDOW="Active Window" INACTIVE_WINDOW="Inactive Window" @@ -333,6 +335,8 @@ out+=(" $QUICK_TWEAKS,^checkout(tweaks)") out2+=("Normal,obtctl tweak normal;$me") out2+=("Small,obtctl tweak small;$me") out2+=("Tiny,obtctl tweak tiny;$me") + out2+=("^sep()") + out2+=(" $RANDOMIZE,obtctl randomizer;$me") out2+=("\"\"\"^sep($RAISED_OR_FLAT?)\"\"\"") [[ "$BEVEL" == "flat" ]] && out2+=(" $FLAT,obtctl raised 0;$me") || out2+=(" $FLAT,obtctl raised 0;$me") [[ "$BEVEL" == "raised" ]] && out2+=(" $RAISED,obtctl raised 1;$me") || out2+=(" $RAISED,obtctl raised 1;$me") @@ -387,7 +391,8 @@ out+=(" $GENERATEFROMWP)") out2+=(" $LIGHTBG ,w2theme ob light;$me") out2+=(" $DARKBG ,w2theme ob dark;$me") - + out2+=("^sep()") + out2+=(" $RANDOMIZE,obtctl randomizer;$me") out+=("^sep($TITLEBAR)") out+=("󰛖 $TITLEBAR_FONT [ ${FNAME} ${FSIZE} ],^checkout(titletext)") diff --git a/bin/obtctl b/bin/obtctl index 235af2c..f93cd50 100755 --- a/bin/obtctl +++ b/bin/obtctl @@ -562,19 +562,25 @@ randomizer () { activegradient "$CLR" "$CLRTO" ### rand gradient type - TYPES=(solid vertical horizontal mirrorhorizontal diagonal pyramid) + TYPES=(solid vertical horizontal mirrorhorizontal diagonal mirrorhorizontal) rand=$((RANDOM%6)) G_TYPE="${TYPES[$rand]}" gradient_type "${G_TYPE}" #rand ### Random border - BORDERS=(0 1 2 4) - rand=$((RANDOM%3)) + BORDERS=(0 0 1 2 4) + rand=$((RANDOM%4)) BORDER="${BORDERS[$rand]}" borderWidth "${BORDER}" + HANDLES=(0 0 2 4) + rand=$((RANDOM%4)) + HANDLE="${HANDLES[$rand]}" + + handlewidth "${HANDLE}" + ### Random padding PADDINGS=(2 4 8 12) rand=$((RANDOM%4)) @@ -583,8 +589,8 @@ randomizer () { paddingHeight "${PADDING}" ### TITLEBAR STYLE - STYLES=(flat raised sunken) - rand=$((RANDOM%3)) + STYLES=(flat raised raised sunken) + rand=$((RANDOM%4)) STYLE="${STYLES[$rand]}" raised "${STYLE}" @@ -634,6 +640,13 @@ randomizer () { buttons "${BUTTON}" + ### Buttons layout + LAYOUTS=(NDSLIMC NDSLIMC NLIMC LIMC) + rand=$((RANDOM%4)) + LAYOUT="${LAYOUTS[$rand]}" + + ndslimc "${LAYOUT}" + #MSG=" #Openbox Window Decoration settings @@ -651,7 +664,7 @@ randomizer () { #Font: ${FAMILY} ${WEIGHT} ${SLANT} ${FONTSIZE} #" # notify-send.sh -R /tmp/randomizer_notify -t 10000 -i mbcc "Mabox Colorizer" "${MSG}" \ - -o "Regenerate:randomizer ob" -o "Customize:colorizer-ob -s" +# -o "Regenerate:randomizer ob" -o "Customize:colorizer-ob -s" } tweak() {