diff --git a/bin/cavactl b/bin/cavactl index f7a9f03..fe046aa 100755 --- a/bin/cavactl +++ b/bin/cavactl @@ -82,6 +82,21 @@ resetcfg () { cat /usr/share/mabox/common/cava/config > ${CFGFILE} reload_config } +start () { + case "$1" in + full|half|third) + mb-setvar cava_width=${1} + ;; + 200|100|50) + mb-setvar cava_height=${1} + ;; + esac + stop + transparent-cava &2>/dev/null +} +stop () { + pkill -f cavatransparent +} info () { case "$LANG" in @@ -120,6 +135,8 @@ case "$1" in framerate)framerate "$2";; noise_reduction)noise_reduction "$2";; resetcfg)resetcfg;; + start) start "$2";; + stop) stop;; info) info;; *):;; esac diff --git a/bin/colorizer-cava b/bin/colorizer-cava index 09bc87c..aa83f45 100755 --- a/bin/colorizer-cava +++ b/bin/colorizer-cava @@ -1,7 +1,7 @@ #!/bin/bash # # colorizer - set of tools for Mabox (auto)theming -# Copyright (C) 2022-2026 Daniel Napora +# Copyright (C) 2022-2026 Daniel Napora # # 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 @@ -16,6 +16,8 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +. $HOME/.config/mabox/mabox.conf + wmctrl -R cavatransparent me="colorizer-cava -s" @@ -49,6 +51,9 @@ case "$LANG" in REVERSE_GRADIENT="Odwróć kolory gradientu" START_CAVA="Uruchom Cava" STOP_CAVA="Zakończ Cava" + CAVA_SIZE="Cava wymiary (okna)" + CWIDTH="Szerokość" + CHEIGHT="Wysokość (px)" GENERATEFROMWP="Generuj z kolorów tapety..." LIGHTBG="Jasne do ciemnego" DARKBG="Ciemne do jesnego" @@ -77,6 +82,9 @@ case "$LANG" in REVERSE_GRADIENT="Reverse gradient's colors" START_CAVA="Start Cava" STOP_CAVA="Stop Cava" + CAVA_SIZE="Cava (window) size" + CWIDTH="Width" + CHEIGHT="Height (px)" GENERATEFROMWP="Generate from wallpaper colors..." LIGHTBG="Light to Dark" DARKBG="Dark to Light" @@ -121,8 +129,24 @@ 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($COLOR_MODE)") - [[ "$GR" == "0" ]] && out+=(" $SOLID_COLOR,cavactl mode solid;$me" "󰝦 $GRADIENT,cavactl mode gradient;$me") || out+=("󰝦 $SOLID_COLOR,cavactl mode solid;$me" " $GRADIENT,cavactl mode gradient;$me") + out+=("^sep()") + cwidth=${cava_width:-half} + cheight=${cava_height:-200} + out+=("$CAVA_SIZE,^checkout(size)") + out2+=("^tag(size)") + out2+=("^sep($CWIDTH)") + for i in full half third + do + [[ "${cava_width}" == "${i}" ]] && out2+=(" $i,cavactl start $i;$me") || out2+=(" $i,cavactl start $i;$me") + done + out2+=("^sep($CHEIGHT)") + for i in 200 100 50 + do + [[ "${cava_height}" == "${i}" ]] && out2+=(" $i,cavactl start $i;$me") || out2+=(" $i,cavactl start $i;$me") + done + + out+=("^sep($COLOR_MODE)") + [[ "$GR" == "0" ]] && out+=(" $SOLID_COLOR,cavactl mode solid;$me" "󰝦 $GRADIENT,cavactl mode gradient;$me") || out+=("󰝦 $SOLID_COLOR,cavactl mode solid;$me" " $GRADIENT,cavactl mode gradient;$me") out+=("^sep($COLORIZE_CAVA)") out+=(" ${FGC} $COLOR,^pipe(mbclr '$FGC' cavactl foreground Cava_Bar_Color '$me')") out+=("^sep($GRADIENT)") @@ -168,8 +192,7 @@ FGT=$(pastel textcolor ${FGC}|pastel format hex) [[ "$NOISE_RED" == "$i" ]] && out2+=(" $i,cavactl noise_reduction $i;$me") || out2+=(" $i,cavactl noise_reduction $i;$me") done - - + out+=("^sep()") out+=(" $EDITCONF,xdg-open ~/.config/cava/config") out+=("󰑓 $_RESETCFG,cavactl resetcfg;$me") @@ -185,7 +208,7 @@ FGT=$(pastel textcolor ${FGC}|pastel format hex) ### 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" diff --git a/share/mabox-colorizer/help/en.html b/share/mabox-colorizer/help/en.html index ece9126..58f3582 100644 --- a/share/mabox-colorizer/help/en.html +++ b/share/mabox-colorizer/help/en.html @@ -875,11 +875,7 @@ If you add more commands, a menu will be shown.

 

//-->
-

Height (px)

- fullwidth: 100% -

50 100 200

- halfwidth: 50% -

50 100 200

+

Use dynamic menu 󰺢 Cava to fine-tune colors, use gradients.

diff --git a/share/mabox-colorizer/help/pl.html b/share/mabox-colorizer/help/pl.html index 926f266..3f2f560 100644 --- a/share/mabox-colorizer/help/pl.html +++ b/share/mabox-colorizer/help/pl.html @@ -780,11 +780,7 @@ Jeśli potrzebujesz pełen zestaw opcji, precyzyjnego dostrajania kolorów i prz

 

//-->
-

Wysokość (px)

- szerokość: 100% -

50 100 200

- szerokość: 50% -

50 100 200

+

Użyj 󰺢 Modułu Cava aby ustawiać gradienty, dopieszczać kolory, itp.