From ab0f7815d2b4a72f8834390345750830a749b3b7 Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Sun, 14 May 2023 14:34:17 +0200 Subject: [PATCH] cava mod upd, pyradio disabled for now --- bin/colorizer | 8 +++---- bin/colorizer-cava | 28 ++++++++++++++++++----- bin/colorizer-pyradio | 36 ++++++++++++++++++++++++------ bin/obtctl | 1 + bin/prtctl | 10 ++++++++- share/mabox-colorizer/help/en.html | 12 +++++----- share/mabox-colorizer/help/pl.html | 12 +++++----- 7 files changed, 77 insertions(+), 30 deletions(-) diff --git a/bin/colorizer b/bin/colorizer index 71c9776..27527ad 100755 --- a/bin/colorizer +++ b/bin/colorizer @@ -305,10 +305,10 @@ out+=("Conky Manager,^pipe(colorizer-conky)") #out+=("TINT2,^pipe(colorizer-tint2)") #out+=("Systray HW monitor,^pipe(colorizer-phwmon)") -if pgrep -f pyradio >/dev/null ;then - out+=("^sep()") - out+=("PyRadio,^pipe(colorizer-pyradio)") -fi +###if pgrep -f pyradio >/dev/null ;then +### out+=("^sep()") +### out+=("PyRadio,^pipe(colorizer-pyradio)") +###fi if pgrep -f cava >/dev/null ;then out+=("^sep()") diff --git a/bin/colorizer-cava b/bin/colorizer-cava index beacc52..82c03cf 100755 --- a/bin/colorizer-cava +++ b/bin/colorizer-cava @@ -16,7 +16,7 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . - +wmctrl -R cavatransparent me="colorizer-cava -s" @@ -43,6 +43,13 @@ fi case "$LANG" in pl*) + INFO="Cava porady" + INFO_HEAD="Porady dla Cava" + INFO_TXT="\n1. Cava jest uruchomiona w przezroczystym oknie...\n \ +Możesz je więc przesuwać lub zmieniać rozmiar tak jak każde inne okno\n \ +Przesuwanie: przytrzymaj Alt i przeciągnij\n \ +Zmiana rozmiaru: przytrzymaj Alt i przeciągnij prawym przyciskiem myszy\n\n \ +2. Użyj strzałek  , aby zmienić szerokość słupków" COLORIZE_CAVA="Pokoloruj Cava" COLOR="Jednolity kolor" REVERSE_GRADIENT="Odwróć kolory gradientu" @@ -64,6 +71,13 @@ case "$LANG" in RELOAD_COLORS="Przeładuj kolory" ;; *) + INFO="CaVa tips & tricks" + INFO_HEAD="Cava tips & tricks" + INFO_TXT="\n1. Cava runs inside transparent window...\n \ +So you can move or resize it like any other window\n \ +Move: hold Alt and drag\n \ +Resize: hold Alt and drag with right mouse button\n\n \ +2. Use arrows   to change bar width" COLORIZE_CAVA="Colorize Cava" COLOR="Solid Color" REVERSE_GRADIENT="Reverse gradient's colors" @@ -105,7 +119,7 @@ FGT=$(pastel textcolor ${FGC}|pastel format hex) } getvalues out+=("^sep($COLORIZE_CAVA)") - + out+=(" ${FGC} $COLOR,^pipe(mbclr '$FGC' cavactl foreground Cava_Bar_Color '$me')") out+=("^sep($GRADIENT)") out+=(" $PREGRADIENT,^pipe(mbgrad cava)") @@ -116,7 +130,9 @@ FGT=$(pastel textcolor ${FGC}|pastel format hex) 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($GENERATEFROMWP)") + out+=(" $LIGHTBG,w2theme cava light;$me") + out+=(" $DARKBG,w2theme cava dark;$me") out+=("^sep($BARS)") out+=("$BAR_WIDTH [ $BW ],^checkout(barwidth)") out2+=("^tag(barwidth)") @@ -137,9 +153,9 @@ FGT=$(pastel textcolor ${FGC}|pastel format hex) out+=(" $EDITCONF,xdg-open ~/.config/cava/config") out+=("󰑓 $RELOAD,cavactl reload;$me") out+=("󰑓 $RELOAD_COLORS,cavactl reload_colors;$me") - out+=("^sep($GENERATEFROMWP)") - out+=(" $LIGHTBG,w2theme cava light;$me") - out+=(" $DARKBG,w2theme cava dark;$me") + out+=("^sep()") + out+=(" $INFO,notify-send.sh -i music -u critical '$INFO_HEAD' '$INFO_TXT'") + ### RUN if [[ "$1" == "-s" ]]; then diff --git a/bin/colorizer-pyradio b/bin/colorizer-pyradio index 3157637..9d2ab29 100755 --- a/bin/colorizer-pyradio +++ b/bin/colorizer-pyradio @@ -19,12 +19,34 @@ # TODO Start Pyradio if not started # TODO check if theme is writeable (users themes) # TODO Save as new theme - +PR_WINID=$(wmctrl -lp |grep 'PyRadio: \|PyRadio -'|cut -d' ' -f1) +wmctrl -iR ${PR_WINID} me="colorizer-pyradio -s" THEMERC=~/.config/pyradio/themes/mbcolors.pyradio-theme +# get wallpaper color palette +WALLPALDIR="$HOME/.cache/colorizer/palettes" +mkdir -p "$WALLPALDIR" +read WALLPATH<<< $(grep file "$HOME"/.config/nitrogen/bg-saved.cfg | cut -d'=' -f2) + +NAME=${WALLPATH////_} +if [[ "${NAME}" =~ ^_home_.* ]]; then +n=${#HOME} +((n++)) +NAME=${NAME:${n}} +fi +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 + + + case "$LANG" in pl*) COLORIZE_PYRADIO="Pokoloruj PyRadio" @@ -50,7 +72,7 @@ case "$LANG" in START_PYRADIO="Start PyRadio" INFO="Info" INFO_HEAD="How it works?" - INFO_TXT="Automatic theme generation works with mbcolors user theme.\n Configuration:/n- use t key to show theme selection dialog\n- navigate to mbcolors theme and press c\n\n" + INFO_TXT="Automatic theme generation works with mbcolors user theme.\n Configuration:\n- use t key to show theme selection dialog\n- navigate to mbcolors theme and press c\n\n" GENERATEFROMWP="Generate from wallpaper colors..." LIGHTBG="Light Background" DARKBG="Dark Background" @@ -82,10 +104,8 @@ read MB1 MB2 MBFG<<< "$(grep '^Messages Border ' ${THEMERC})" out+=("^sep($COLORIZE_PYRADIO)") #out+=("$START_PYRADIO,terminator --geometry=420x440-20-20 -e pyradio") - out+=(" $INFO,notify-send.sh -i music '$INFO_HEAD' '$INFO_TXT' -t 20000") - out+=("^sep($GENERATEFROMWP)") - out+=("$LIGHTBG,w2theme pyradio light;$me") - out+=("$DARKBG,w2theme pyradio dark;$me") + out+=(" $INFO,notify-send.sh -i pyradio -u critical '$INFO_HEAD' '$INFO_TXT'") + out+=("^sep($SETCOLORS)") out+=(" AbCd Stations,^checkout(stations)") out2+=("^tag(stations)") @@ -126,7 +146,9 @@ read MB1 MB2 MBFG<<< "$(grep '^Messages Border ' ${THEMERC})" out+=(" $RESETTHEME,prtctl resettheme;$me") out+=("^sep()") out+=("$EXPORTTHEME,prtctl exp;$me") - + out+=("^sep($GENERATEFROMWP)") + out+=("$LIGHTBG,w2theme pyradio light;$me") + out+=("$DARKBG,w2theme pyradio dark;$me") out+=("^sep($CONFIG_AND_DOCS)") #out+=("PyRadio README,cat /usr/share/doc/pyradio/README.html| yad --html --no-buttons --no-escape --height=800 --width=600") out+=(" $README,xdg-open /usr/share/doc/pyradio/README.html") diff --git a/bin/obtctl b/bin/obtctl index eccc406..1f2a594 100755 --- a/bin/obtctl +++ b/bin/obtctl @@ -430,6 +430,7 @@ randomizer () { #SHADOW="${SHADOWS[$rand]}" #shadow "${SHADOW}" + shadow no ### RANDOM GRADIENT COLORS GRADIENT_FILE="$HOME"/.config/colorizer/gradients_all.inc diff --git a/bin/prtctl b/bin/prtctl index b389c57..2ba9310 100755 --- a/bin/prtctl +++ b/bin/prtctl @@ -6,7 +6,7 @@ THEMERC=~/.config/pyradio/themes/mbcolors.pyradio-theme CONF_DIR="$HOME/.config/pyradio/" - +CONF_FILE="$CONF_DIR/config" stations() { sd "^Stations .*$" "Stations $1 $2" ${THEMERC} @@ -115,6 +115,14 @@ PyRadio URL #d2cda1 # Message window border foreground # (background color will come from Stations) Messages Border #d3d4bf + +# Theme Transparency +# Values are: +# 0: No transparency (default) +# 1: Theme is transparent +# 2: Obey config setting +transparency 0 + EOF } export_theme () { diff --git a/share/mabox-colorizer/help/en.html b/share/mabox-colorizer/help/en.html index 291785f..cc1c035 100644 --- a/share/mabox-colorizer/help/en.html +++ b/share/mabox-colorizer/help/en.html @@ -61,7 +61,7 @@ nav button.w3-bar-item {padding:4px 12px !important;} - + @@ -542,19 +542,19 @@ You can add your own commands to each Conky, which will be show