cava colorizer upd

This commit is contained in:
2026-02-23 11:32:11 +01:00
parent f9d85d90d6
commit 29ff0b2097
4 changed files with 48 additions and 16 deletions

View File

@@ -82,6 +82,21 @@ resetcfg () {
cat /usr/share/mabox/common/cava/config > ${CFGFILE} cat /usr/share/mabox/common/cava/config > ${CFGFILE}
reload_config 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 () { info () {
case "$LANG" in case "$LANG" in
@@ -120,6 +135,8 @@ case "$1" in
framerate)framerate "$2";; framerate)framerate "$2";;
noise_reduction)noise_reduction "$2";; noise_reduction)noise_reduction "$2";;
resetcfg)resetcfg;; resetcfg)resetcfg;;
start) start "$2";;
stop) stop;;
info) info;; info) info;;
*):;; *):;;
esac esac

View File

@@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
# #
# colorizer - set of tools for Mabox (auto)theming # colorizer - set of tools for Mabox (auto)theming
# Copyright (C) 2022-2026 Daniel Napora <napcok@gmail.com> # Copyright (C) 2022-2026 Daniel Napora <danieln@maboxlinux.org>
# #
# This program is free software: you can redistribute it and/or modify # 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 # 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 # You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>. # along with this program. If not, see <http://www.gnu.org/licenses/>.
. $HOME/.config/mabox/mabox.conf
wmctrl -R cavatransparent wmctrl -R cavatransparent
me="colorizer-cava -s" me="colorizer-cava -s"
@@ -49,6 +51,9 @@ case "$LANG" in
REVERSE_GRADIENT="Odwróć kolory gradientu" REVERSE_GRADIENT="Odwróć kolory gradientu"
START_CAVA="Uruchom Cava" START_CAVA="Uruchom Cava"
STOP_CAVA="Zakończ Cava" STOP_CAVA="Zakończ Cava"
CAVA_SIZE="Cava wymiary (okna)"
CWIDTH="Szerokość"
CHEIGHT="Wysokość (px)"
GENERATEFROMWP="Generuj z kolorów tapety..." GENERATEFROMWP="Generuj z kolorów tapety..."
LIGHTBG="Jasne do ciemnego" LIGHTBG="Jasne do ciemnego"
DARKBG="Ciemne do jesnego" DARKBG="Ciemne do jesnego"
@@ -77,6 +82,9 @@ case "$LANG" in
REVERSE_GRADIENT="Reverse gradient's colors" REVERSE_GRADIENT="Reverse gradient's colors"
START_CAVA="Start Cava" START_CAVA="Start Cava"
STOP_CAVA="Stop Cava" STOP_CAVA="Stop Cava"
CAVA_SIZE="Cava (window) size"
CWIDTH="Width"
CHEIGHT="Height (px)"
GENERATEFROMWP="Generate from wallpaper colors..." GENERATEFROMWP="Generate from wallpaper colors..."
LIGHTBG="Light to Dark" LIGHTBG="Light to Dark"
DARKBG="Dark to Light" DARKBG="Dark to Light"
@@ -121,6 +129,22 @@ FGT=$(pastel textcolor ${FGC}|pastel format hex)
} }
getvalues getvalues
pgrep -f cavatransparent > /dev/null && out+=("<big>󰺢</big> $STOP_CAVA,mb-music cavakill;$me") || out+=("<big>󰺢</big> $START_CAVA,mb-music cavastart;$me") pgrep -f cavatransparent > /dev/null && out+=("<big>󰺢</big> $STOP_CAVA,mb-music cavakill;$me") || out+=("<big>󰺢</big> $START_CAVA,mb-music cavastart;$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+=("<big>綠</big> <b>$i</b>,cavactl start $i;$me") || out2+=("<big>祿</big> $i,cavactl start $i;$me")
done
out2+=("^sep($CHEIGHT)")
for i in 200 100 50
do
[[ "${cava_height}" == "${i}" ]] && out2+=("<big>綠</big> <b>$i</b>,cavactl start $i;$me") || out2+=("<big>祿</big> $i,cavactl start $i;$me")
done
out+=("^sep($COLOR_MODE)") out+=("^sep($COLOR_MODE)")
[[ "$GR" == "0" ]] && out+=("<big>綠</big> $SOLID_COLOR,cavactl mode solid;$me" "<big>󰝦</big> $GRADIENT,cavactl mode gradient;$me") || out+=("<big>󰝦</big> $SOLID_COLOR,cavactl mode solid;$me" "<big>綠</big> $GRADIENT,cavactl mode gradient;$me") [[ "$GR" == "0" ]] && out+=("<big>綠</big> $SOLID_COLOR,cavactl mode solid;$me" "<big>󰝦</big> $GRADIENT,cavactl mode gradient;$me") || out+=("<big>󰝦</big> $SOLID_COLOR,cavactl mode solid;$me" "<big>綠</big> $GRADIENT,cavactl mode gradient;$me")
out+=("^sep($COLORIZE_CAVA)") out+=("^sep($COLORIZE_CAVA)")
@@ -169,7 +193,6 @@ FGT=$(pastel textcolor ${FGC}|pastel format hex)
done done
out+=("^sep()") out+=("^sep()")
out+=("<big></big> $EDITCONF,xdg-open ~/.config/cava/config") out+=("<big></big> $EDITCONF,xdg-open ~/.config/cava/config")
out+=("<big>󰑓</big> $_RESETCFG,cavactl resetcfg;$me") out+=("<big>󰑓</big> $_RESETCFG,cavactl resetcfg;$me")
@@ -185,7 +208,7 @@ FGT=$(pastel textcolor ${FGC}|pastel format hex)
### RUN ### RUN
if [[ "$1" == "-s" ]]; then if [[ "$1" == "-s" ]]; then
. /usr/share/mb-jgtools/pipemenu-standalone.cfg . /usr/share/mb-jgtools/pipemenu-standalone.cfg
. $HOME/.config/mabox/mabox.conf
CNF_DIR="$HOME/.config/colorizer" CNF_DIR="$HOME/.config/colorizer"
CNF_FILE="$CNF_DIR/colorizer.conf" CNF_FILE="$CNF_DIR/colorizer.conf"

View File

@@ -875,11 +875,7 @@ If you add more commands, a menu will be shown.</p>
<p>&nbsp;</p> <p>&nbsp;</p>
</div>//--> </div>//-->
<div class="col m4 center colors"> <div class="col m4 center colors">
<p><strong>Height (px)</strong></p>
fullwidth: 100%
<p><a class="tag dark-gray" href="run://mb-music cavastart 50 full">50</a> <a class="tag dark-gray" href="run://mb-music cavastart 100 full">100</a> <a class="tag dark-gray" href="run://mb-music cavastart 200 full">200</a></p>
halfwidth: 50%
<p><a class="tag dark-gray" href="run://mb-music cavastart 50 half">50</a> <a class="tag dark-gray" href="run://mb-music cavastart 100 half">100</a> <a class="tag dark-gray" href="run://mb-music cavastart 200 half">200</a></p>
</div> </div>
</div> </div>
<p>Use dynamic menu <a class="tag small orange" href="run://colorizer-cava -s">󰺢 Cava</a> to fine-tune colors, use gradients.</p> <p>Use dynamic menu <a class="tag small orange" href="run://colorizer-cava -s">󰺢 Cava</a> to fine-tune colors, use gradients.</p>

View File

@@ -780,11 +780,7 @@ Jeśli potrzebujesz pełen zestaw opcji, precyzyjnego dostrajania kolorów i prz
<p>&nbsp;</p> <p>&nbsp;</p>
</div>//--> </div>//-->
<div class="col m4 center"> <div class="col m4 center">
<p><strong>Wysokość (px)</strong></p>
szerokość: 100%
<p><a class="tag dark-gray" href="run://mb-music cavastart 50 full">50</a> <a class="tag dark-gray" href="run://mb-music cavastart 100 full">100</a> <a class="tag dark-gray" href="run://mb-music cavastart 200 full">200</a></p>
szerokość: 50%
<p><a class="tag dark-gray" href="run://mb-music cavastart 50 half">50</a> <a class="tag dark-gray" href="run://mb-music cavastart 100 half">100</a> <a class="tag dark-gray" href="run://mb-music cavastart 200 half">200</a></p>
</div> </div>
</div> </div>
<p>Użyj <a class="tag small orange" href="run://colorizer-cava -s"> 󰺢 Modułu Cava</a> aby ustawiać gradienty, dopieszczać kolory, itp.</p> <p>Użyj <a class="tag small orange" href="run://colorizer-cava -s"> 󰺢 Modułu Cava</a> aby ustawiać gradienty, dopieszczać kolory, itp.</p>