Created 2 Cli-Visualizer tweakers... (alt for cava)... (yad & jgmenu)

Hola Mabox Linux lovers…

About 7 months ago (using/testing it since), I have been developing a GUI tweaker for Cli-visualizer an alternative to CAVA.
The tweaker adjusts the most basic settings to customize the look and feel of the visualizer.
Switch between Spectrum, Lorenz and Ellipse.

On GITLAB cli-visualizer_yad more info and Install.sh script, to install everything in one go.

There is also a script to uninstall it. (except config files).

Let me know if there is something that could be improved.

:bird:

4 Likes

Wow! This looks very interesting.

I’ll install and test it in a few days when I get home from a short vacation out of town and mostly offline :slight_smile:

3 Likes

MB-SETVAR was corrupted.
Somehow I changed the config path.

Uploaded the original mb-setvar on Gitlab.

Or simply delete it from $HOME/bin dir and use system /usr/bin/mb-setvar.

:bird:

2 Likes

Small comment / changes gitlab:

muzlabz cli-visualizer_yad

I removed mb-setvar from install script. The install is now only for Mabox.

:bird:

1 Like

FUN fact: :carousel_horse:

Changing these characters is playing with transparancy.

:bird:

2 Likes

I just installed it, impressive and lot to explore :slight_smile:

2 Likes

I would like to change the character part.
But not sure if yad would allow it. (dynamic input)

  • When choosing one of the visualizers, only the character dropdown of that visualizer is shown for selecting a character.
    This makes the window a wee bit shorter.

  • Choosing a yad icon is a chalange (icon themes).
    But probably thats a common thing to deal with.
    For the rest i am quite happy with it…

R for refresh is not alway’s working. Not sure why yet… Not a big thing though.

:bird:

1 Like

Question:

I have a glitch with the visualizer. I am using Pipewire.
Do you experience the same?
I hope it’s only me…

Video example vimeo

:bird:

Hi @muzqs
I don’t see glitches.

Maybe it is a good idea to run killall -USR1 vis after every Save settings. It should reload config without need to press r manually…

1 Like

Thanks.
Updated gitlab with these changes. Good one.
The r is a thing of vis itself, but indeed not needed.

Good to hear the Glitch is just me…

:bird:

1 Like

I haven’t checked the updated script, but looking at the commit it seems that starting transparent-vis is unnecessary.

killall -USR1 vis is not killing vis process, it is just hint to vis to reload its config.

2 Likes

I understand your point, but…

When using killall -USR1 vis it changes the conf indeed but also kills transparent-vis.sh.

That’s why it needs to restart, i think.

Comment:
Reload (R) was working for some settings (like changing visualizer).
The behaviour was that it kept running after the reload.
But, like color settings did’t work with reload.

last update: The same as before, but combined.

# restarting
restart_vis() {
    killall -USR1 vis
    transparent-vis.sh 200 & 
}

PART OF CODE.

echo "Settings saved to $CONFIG_FILE."
        notify-send -i games-config-custom -t 5000 "VIS settings saved"
        
        # Save settings
        restart_vis
        get_settings

    elif [ $button -eq 1 ]; then
        # Genarate Random colors
        generate_colors 
        restart_vis 
        get_settings

    elif [ $button -eq 2 ]; then
        # Execute the script for choosing a fixed theme
        yad-select-file.sh 
        restart_vis
        get_settings

    elif [ $button -eq 4 ]; then
        # Give name to theme
        rename-vis-colors.sh    
        get_settings

    elif [ $button -eq 5 ]; then
        # Create theme with yad color pick
        vis-yad-colors.sh 
        restart_vis
        get_settings

    else
        echo "Operation canceled."
    fi
}

EXPECTED BEHAVIOUR ?

  • After config value changes, using killall -USR1 vis,
    will reload config and rerun transparent-vis.sh with new changes.

:bird:

1 Like

Double check this :slight_smile:
killall -USR1 vis does not kill anything, just force vis process to reload its config - it is the same as pressing r.
see vis readme about reloading config

I use this signal a lot in my scripts

2 Likes

:slight_smile: I understand. Maybe my writing is not right.

But when i use only the killall -USR1 vis command it closes vis-transparent.sh.

  • When removing part transparent-vis.sh 200.
    transparent-vis.sh does not reload as it should. (it kills itself)

Need some time to investicate… Thanks for the feedback.

:bird:

1 Like

I think i found the bug. Looks like a bug.

$ vis -c ~/.config/vis/mb-vis-config

output
$ Invalid settings visualizer.spectrum.falloff.weight=0

but the mb-vis-config gives the right value.

visualizer.spectrum.falloff.weight=0.93

Terminator? doesn’t read .9+, the dot and everything behind the dot ..
I use these directions.

Readme comment.
##best 0.9+ and small changes in this value can have a large effect. Defaults to 0.95

It changes the config, but because of the error terminator kills itself.
I cannot solf this error. (bug)

For now restart transparent-vis.sh seems a work around.

:bird:

1 Like

update:

#Monster cat smoothing is inspired by the monster cat youtube channel (https://www.youtube.com/user/MonstercatMedia). 
#To control the amount of smoothing for montercat use visualizer.monstercat.smoothing.factor. 
#The default smoothing factor for monstercat is 1.5. Increase the smoothing factor by a lot could hurt performance.
visualizer.monstercat.smoothing.factor=1.5

I added this to the config. And the glitching is gone. :slight_smile:

1 Like

Update Cli-visualizer tweaker : from yad to jgmenu.


jgmenuV2

Thanks @napcok for the amazing scripts to use as template, slowly learning from it.

The best place to learn jgmenu = mabox

Mabox mentioned at jgmenu github, the distro with advanced usage of jgmenu.

Posting code for archive/view/inspiration/etc. In development.

colorizer-vis (a fork of colorizer-cava) : with uses of some scripts from vismanager yad version.

Update edit: 23-10-24

#!/bin/bash
#    Adapted by @musqz for cli-visualizer. 2024

#    Copyright (C) 2022-2023 Daniel Napora    <napcok@gmail.com>
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  

wmctrl -R vistransparent

me="colorizer-vis -s"

CONFIG_DIR="$HOME/.config/vis"
VIS_CNFG="$CONFIG_DIR/mb-vis-config"
CNFG_AMOUNT="$CONFIG_DIR/.amount"
COLORS_FILE="$CONFIG_DIR/colors/mb-vis-colors"
SCHEME_DIR="$CONFIG_DIR/colors"


source <(grep = "$VIS_CNFG")
source <(grep = "$CNFG_AMOUNT")
source <(grep = "$COLORS_FILE")

files=$(find "$SCHEME_DIR" -type f -name "*" -printf "%f\n" | sort)



for scheme in "$SCHEME_DIR"/*; do
    if [[ -f "$scheme" ]]; then
        # Source each file
        source <(grep = "$scheme")
        # notify-send -t 50 "scheme files sourced"
    else
    notify-send -t 50000 "Error creating source scheme's"
    fi
    
done

case "$LANG" in
    pl*)
    INFO="Vis porady"
    INFO_HEAD="Porady dla Vis"
    INFO_TXT="\n1. Vis jest uruchomiona w przezroczystym oknie...\n \
Możesz je więc <b>przesuwać</b> lub <b>zmieniać rozmiar</b> tak jak każde inne okno\n \
<i>Przesuwanie</i>: przytrzymaj <b>Alt</b> i przeciągnij\n \
<i>Zmiana rozmiaru</i>: przytrzymaj <b>Alt</b> i przeciągnij prawym przyciskiem myszy\n\n \
2. Użyj strzałek <b> </b>, aby zmienić szerokość słupków"
    START_VIS="Uruchom Vis"
    STOP_VIS="Zakończ Vis"
    _COLORIZER_ROOT="<b>Colorizer</b> - menu główne"
    ;;
    *)
    INFO="Vis tips &amp; tricks"
    INFO_HEAD="Vis tips & tricks"
    INFO_TXT="\n1. Vis runs inside transparent window...\n \
So you can <b>move</b> or <b>resize</b> it like any other window\n \
<i>Move</i>: hold <b>Alt</b> and drag\n \
<i>Resize</i>: hold <b>Alt</b> and drag with right mouse button\n\n \
2. Use <b>Ctrl+wheel</b> bar size\n \
3. Use <b>S</b> toggle stereo / mono"
    START_VIS="Start Vis"
    STOP_VIS="Stop Vis"
    EDITCONF="Edit config file"
	_COLORIZER_ROOT="<b>Colorizer</b> rootmenu"
    ;;
esac

    visualizer_spectrum_reversed=$(awk -F'=' '/visualizer\.spectrum\.reversed=/ {print $2}' "$VIS_CNFG")
    colors_scheme=$(awk -F'=' '/colors\.scheme=/ {print $2}' "$VIS_CNFG" )
    bar_width="$(awk -F'=' '/visualizer\.spectrum\.bar\.width=/ {print $2}' "$VIS_CNFG" )"
    bar_spacing=$(awk -F'=' '/visualizer\.spectrum\.bar\.spacing=/ {print $2}' "$VIS_CNFG" )
    smoothing_mode=$(awk -F'=' '/visualizer\.spectrum\.smoothing\.mode=/ {print $2}' "$VIS_CNFG" )
    falloff_mode=$(awk -F'=' '/visualizer\.spectrum\.falloff\.mode=/ {print $2}' "$VIS_CNFG" )
    falloff_weight=$(awk -F'=' '/visualizer\.spectrum\.falloff\.weight=/ {print $2}' "$VIS_CNFG" )
    stereo_mode=$(awk -F'=' '/audio\.stereo\.enabled=/ {print $2}' "$VIS_CNFG" )
    fps=$(awk -F'=' '/visualizer\.fps=/ {print $2}' "$VIS_CNFG" )
    amount_colors=$(awk -F'=' '/amount_colors=/ {print $2}' "$HOME/.config/vis/.amount" )
    visualizers=$(awk -F'=' '/visualizers=/ {print $2}' "$VIS_CNFG" )
    selected_char_spectrum=$(awk -F'=' '/visualizer\.spectrum\.character=/ {print $2}' "$VIS_CNFG" )
    selected_char_lorenz=$(awk -F'=' '/visualizer\.lorenz\.character=/ {print $2}' "$VIS_CNFG" )
    selected_char_ellipse=$(awk -F'=' '/visualizer\.ellipse\.character=/ {print $2}' "$VIS_CNFG" )
  
        
    
    pgrep -f vistransparent > /dev/null && out+=("<big>󰺢</big>   $STOP_VIS                   ,mb-music viskill;$me") || out+=("<big>󰺢</big>  $START_VIS                  ,mb-music visstart;$me")
    
    out+=("^sep(Basic settings)")
    out+=("Bar width      [<b>${bar_width}</b>],^checkout(barwidth)")
    out2+=("^tag(barwidth)")
    for i in 1 2 3 4 5 6 8 10 ; do out2+=("$i,mb-setvar visualizer.spectrum.bar.width=$i $VIS_CNFG;mb-music visstart;$me") ;done
    
    out+=("Bar spacing    [<b>$bar_spacing</b>],^checkout(barspacing)")
    out2+=("^tag(barspacing)")
    for i in 0 1 2 3 4 5 6 8 10 ; do out2+=("$i,mb-setvar visualizer.spectrum.bar.spacing=$i    $VIS_CNFG ; mb-music visstart;$me") ;done
    
    out+=("Random colors  [<b>$amount_colors</b>],^checkout(randomclr)")
    out2+=("^tag(randomclr)")
    out2+=("<span fgcolor='#131926' bgcolor='#A2C5CD' > <b>Repeat</b>   </span>     ,mb-setvar colors.scheme=mb-vis-colors $VIS_CNFG ; mb-setvar amount_colors=$amount_colors    ~/.config/vis/.amount ;  ~/bin/vis-random-colors.sh ; mb-music visstart;$me")
    out2+=("^sep()")
    for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 ; do out2+=("$i,mb-setvar colors.scheme=mb-vis-colors $VIS_CNFG ; mb-setvar amount_colors=$i    ~/.config/vis/.amount ;  ~/bin/vis-random-colors.sh ; mb-music visstart;$me") ;done
    
    out2+=("^tag(gradient)")
    out+=("Gradient       [toggle], vis_toggle-gradient.sh; mb-music visstart;$me")
    
    out+=("^sep()")
    out+=("<span bgcolor='#44475a'> Save this colors             </span>,rename-vis-colors.sh;mb-music visstart;$me")
    out+=("^sep()")
    
    out+=(" Colorscheme [<b>$colors_scheme</b>],^checkout(scheme)>")
    out2+=("^tag(scheme)")
    for i in ${files} ; do out2+=("$i,mb-setvar colors.scheme=$i   $VIS_CNFG ;mb-music visstart;$me") ;done
    out+=("^sep()")
    
    out+=("Falloff       [<b>$falloff_mode</b>],^checkout(falloff)")
    out2+=("^tag(falloff)")
    for i in fill top none ; do out2+=("$i,mb-setvar visualizer.spectrum.falloff.mode=$i    $VIS_CNFG ;mb-music visstart;$me") ;done
    
    out+=("Fallweight    [<b>$falloff_weight</b>],^checkout(fallweight)")
    out2+=("^tag(fallweight")
    for i in 0.90 0.91 0.92 0.93 0.94 0.95 0.96 0.97 0.98 0.99 ; do out2+=("$i,mb-setvar visualizer.spectrum.falloff.weight=$i    $VIS_CNFG ;mb-music visstart;$me") ;done

    out+=("Smooth        [<b>$smoothing_mode</b>],^checkout(smooth)")
    out2+=("^tag(smooth)")    
    for i in sgs monstercat none ; do out2+=("$i,mb-setvar visualizer.spectrum.smoothing.mode=$i    $VIS_CNFG ;mb-music visstart;$me") ;done
        
    out+=("Fps           [<b>$fps</b>],^checkout(fps)")
    out2+=("^tag(fps)")
    for i in 5 6 7 8 9 10 11 12 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 ; do out2+=("$i,mb-setvar visualizer.fps=$i    $VIS_CNFG ;mb-music visstart;$me") ;done
 
    out+=("Visuals       [<b>$visualizers</b>],^checkout(visuals)")
    out2+=("^tag(visuals)")
    for i in spectrum lorenz ellipse ; do out2+=("$i,mb-setvar visualizers=$i    $VIS_CNFG ;mb-music visstart;$me") ;done

    out+=("Character,^checkout(charspec)")
    out2+=("^tag(charspec)")
    out2+=("^sep(Spectrum [ <b>$selected_char_spectrum</b> ])")
    for i in █ ▀ ⬜ ▓ ▒ ░ ▨ ; do out2+=("$i,mb-setvar visualizer.spectrum.character=$i    $VIS_CNFG ;mb-music visstart;$me") ;done

    out1+=("^tag(charlrnz)")
    out2+=("^sep(Lorenz   [ <b>$selected_char_lorenz</b> ])")
    for i in █ ▀ ⬜ ▓ ▒ ░ ▨ ; do out2+=("$i,mb-setvar visualizer.lorenz.character=$i    $VIS_CNFG ;mb-music visstart;$me") ;done

    out1+=("^tag(charellps)")
    out2+=("^sep(Ellipse  [ <b>$selected_char_ellipse</b> ])")
    for i in █ ▀ ⬜ ▓ ▒ ░ ▨  ; do out2+=("$i,mb-setvar visualizer.ellipse.character=$i    $VIS_CNFG ;mb-music visstart;$me") ;done

    out+=("Reversed      ,^checkout(reversed)")
    out2+=("^tag(reversed)")
    for i in false true ; do
    case $i in
        false) label1="no" ;;
        true)  label1="yes" ;;
    esac 
    out2+=("$label1,mb-setvar visualizer.spectrum.reversed=$i    $VIS_CNFG ;mb-music visstart;$me") ;done

    out+=("Stereo        ,^checkout(stereo)")
    out2+=("^tag(stereo)")
    for i in false true ; do
    case $i in
        false) label="no" ;;
        true)  label="yes" ;;
    esac 
    out2+=("$label,mb-setvar audio.stereo.enabled=$i    $VIS_CNFG ;mb-music visstart;$me") ;done

    
    out+=("^sep()")
    out+=("   Scheme  -create   (gtk),vis-yad-colors.sh;mb-music visstart;$me")
    out+=("   Scheme  -edit,xdg-open $HOME/.config/vis/colors;$me")
    
    out+=("   $EDITCONF,xdg-open $HOME/.config/vis/mb-vis-config")
    
    out+=("^sep()")
    out+=("   $INFO,notify-send.sh -i carla -u critical '$INFO_HEAD' '$INFO_TXT'")
    

### RUN
if [[ "$1" == "-s" ]]; then
    . /usr/share/mb-jgtools/pipemenu-standalone.cfg
    . $HOME/.config/mabox/mabox.conf
    
    CNF_DIR="$HOME/.config/colorizer"
    CNF_FILE="$CNF_DIR/colorizer.conf"
    source "$CNF_FILE"

    out+=("^sep()")
    out+=(" ${arrow_string_left}    $_COLORIZER_ROOT,colorizer -s")
    
    if [[ "$colorizer_size" == "full" ]];then
    eval $(xdotool getdisplaygeometry --shell)
    MENU_HEIGHT_MIN="$HEIGHT"
    MENU_HEIGHT_MAX=$MENU_HEIGHT_MIN
    jgtools_radius=0
    menu_margin_x="0"
    else
    MENU_VALIGN="center"
    menu_margin_x=${submenu_spacing:-0}
    fi
    
    MENU_HALIGN="left"
    jgmenu_icon_size=0
    
    [ $(pidof picom) ] && MENU_RADIUS=$jgtools_radius
    [ -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 | 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
        convert ${WALLPATH} -resize 270x150^ -gravity center -extent 270x150 ${THUMB}
    fi
    
    mkconfigfile

# jumpers
clr2=#FF0000
# bars
clr=#82c2bf
clr3=#00ffff
clr4=#76eec6


cat <<EOF > ${MENU_ITEMS}
@icon,,$((jgtools_padding)),$((jgtools_padding)),270,150,4,left,top,,,${THUMB}


@rect,,$((jgtools_padding)),$((jgtools_padding+80)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding)),$((jgtools_padding+100)),12,50,0,left,top,,${clr} 100,
@rect,,$((jgtools_padding+20)),$((jgtools_padding+75)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+20)),$((jgtools_padding+115)),12,35,0,left,top,,${clr3} 100,
@rect,,$((jgtools_padding+40)),$((jgtools_padding+90)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+40)),$((jgtools_padding+124)),12,26,0,left,top,,${clr4} 100,
@rect,,$((jgtools_padding+60)),$((jgtools_padding+85)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+60)),$((jgtools_padding+114)),12,36,0,left,top,,${clr} 100,
@rect,,$((jgtools_padding+80)),$((jgtools_padding+55)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+80)),$((jgtools_padding+100)),12,50,0,left,top,,${clr4} 100,
@rect,,$((jgtools_padding+100)),$((jgtools_padding+35)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+100)),$((jgtools_padding+96)),12,54,0,left,top,,${clr3} 100,
@rect,,$((jgtools_padding+120)),$((jgtools_padding+15)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+120)),$((jgtools_padding+74)),12,76,0,left,top,,${clr} 100,
@rect,,$((jgtools_padding+140)),$((jgtools_padding+35)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+140)),$((jgtools_padding+64)),12,86,0,left,top,,${clr3} 100,
@rect,,$((jgtools_padding+160)),$((jgtools_padding+23)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+160)),$((jgtools_padding+76)),12,74,0,left,top,,${clr4} 100,
@rect,,$((jgtools_padding+180)),$((jgtools_padding+75)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+180)),$((jgtools_padding+94)),12,56,0,left,top,,${clr} 100,
@rect,,$((jgtools_padding+200)),$((jgtools_padding+60)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+200)),$((jgtools_padding+114)),12,36,0,left,top,,${clr} 100,
@rect,,$((jgtools_padding+220)),$((jgtools_padding+99)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+220)),$((jgtools_padding+129)),12,21,0,left,top,,${clr4} 100,
@rect,,$((jgtools_padding+240)),$((jgtools_padding+66)),12,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+240)),$((jgtools_padding+119)),12,31,0,left,top,,${clr3} 100,
@rect,,$((jgtools_padding+260)),$((jgtools_padding+28)),10,10,0,left,top,,${clr2} 100,
@rect,,$((jgtools_padding+260)),$((jgtools_padding+110)),10,40,0,left,top,,${clr} 100,

@rect,,${jgtools_padding},$((jgtools_padding + 120)),270,28,0,left,top,#222222 20,#222222 70,
@text,,$((jgtools_padding + 4)),$((jgtools_padding + 120)),120,28,0,left,top,#FFFFFF ,${WINCLR},<span size='10400' font_family='Ubuntu'><b>Tweak</b> Cli-visualizer</span>


$(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
    exit 0
fi

printf '%s\n' "${out[@]}"
printf '%s\n' "${out1[@]}"
printf '%s\n' "${out2[@]}"

:bird:

1 Like

I think, the most is covert now…

EDIT: 23-10-24 added some more pics…
Soonies gitlab upload with all needed scripts and files. FYI…

:bird:

FYI…

Colorizer-vis (fork colorizer-cava).

:bird:

1 Like

Big update: removed most of scripts and put them in one.

:bird:

Check last version. Some small changes.

10-nov-2024

1 Like