From fd759a4cc66c67071849e3bae6decfe41c60fb9e Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Sun, 28 Jan 2024 11:39:35 +0100 Subject: [PATCH] AVIF image support for Colorizer --- local/bin/nitrogen | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/local/bin/nitrogen b/local/bin/nitrogen index 1d8aa31..651538d 100755 --- a/local/bin/nitrogen +++ b/local/bin/nitrogen @@ -41,9 +41,15 @@ n=${#HOME} ((n++)) NAME=${NAME:${n}} fi +ext="${WALLPATH##*.}" +#notify-send.sh "Extension" "$ext" 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" + if [ "$ext" == "avif" ];then + convert ${WALLPATH} -resize 25% -colors 16 -unique-colors txt:- |grep -v '^#'| awk '{print substr($3,1,3) substr($3,6,2) substr($3,10,2)}' |pastel sort-by brightness |pastel format hex > "$WALLPALDIR/$NAME.clr" + else + 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 fi # GENERATE THUMBNAIL @@ -60,10 +66,10 @@ convert ${WALLPATH} -resize 52x52^ -gravity center -extent 52x52 -bordercolor wh killall -SIGUSR1 tint2 # auto generate themes -if command -v w2theme &> /dev/null -then -source ~/.config/colorizer/colorizer.conf - if [[ "$wall2themes" == "yes" ]];then - w2theme colorize - fi -fi +#if command -v w2theme &> /dev/null +#then +#source ~/.config/colorizer/colorizer.conf +# if [[ "$wall2themes" == "yes" ]];then +# w2theme colorize +# fi +#fi