From d6d6742819a369f07259f8501430acbfd00f72bb Mon Sep 17 00:00:00 2001 From: Daniel Napora Date: Sat, 21 Mar 2026 14:29:13 +0100 Subject: [PATCH] mb-canvas 2 monitor update --- bin/mb-canvas | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/bin/mb-canvas b/bin/mb-canvas index 3018d0b..6e44016 100755 --- a/bin/mb-canvas +++ b/bin/mb-canvas @@ -52,7 +52,8 @@ esac DIR="$(xdg-user-dir PICTURES)/imagick" -size="$(xrandr --current | grep '*' | uniq | awk '{print $1}')" +#size="$(xrandr --current | grep '*' | uniq | awk '{print $1}')" +size=$(xrandr | grep ' primary' | grep -o '[0-9]*x[0-9]*' | head -1) name="imagick_$(date +%Y-%m-%d_%I-%M-%S).${extension}" #SETTER="feh --bg-scale"; SETTER="nitrogen --set-scaled --save" @@ -98,30 +99,30 @@ color_picker() { notify-send.sh "$_IMWG" "$_PICKCOLORS: 2" -i mbcc --expire-time=12000 color1=$($picker_app) FNAME="/tmp/${color1:1:6}.png" - convert -size 100x100 xc:"$color1" "$FNAME" + magick -size 100x100 xc:"$color1" "$FNAME" notify-send.sh "$_PICKEDCOLOR 1" "$color1\n $_PICKNEXT..." --icon="$FNAME" --expire-time=12000 color2=$($picker_app) FNAME="/tmp/${color2:1:6}.png" - convert -size 100x100 xc:"$color2" "$FNAME" + magick -size 100x100 xc:"$color2" "$FNAME" notify-send.sh "$_PICKEDCOLOR 2" "$color1\n $_PICKEDALL" --icon="$FNAME" --expire-time=12000 color="$color1-$color2" elif [[ "$BGRADIENT" == "true" ]]; then notify-send.sh "$_IMWG" "$_PICKCOLORS: 4" -i mbcc --expire-time=12000 color1=$($picker_app) FNAME="/tmp/${color1:1:6}.png" - convert -size 100x100 xc:"$color1" "$FNAME" + magick -size 100x100 xc:"$color1" "$FNAME" notify-send.sh "$_PICKEDCOLOR 1" "$color1\n $_PICKNEXT..." --icon="$FNAME" --expire-time=12000 color2=$($picker_app) FNAME="/tmp/${color2:1:6}.png" - convert -size 100x100 xc:"$color2" "$FNAME" + magick -size 100x100 xc:"$color2" "$FNAME" notify-send.sh "$_PICKEDCOLOR 2" "$color2\n $_PICKNEXT..." --icon="$FNAME" --expire-time=12000 color3=$($picker_app) FNAME="/tmp/${color3:1:6}.png" - convert -size 100x100 xc:"$color3" "$FNAME" + magick -size 100x100 xc:"$color3" "$FNAME" notify-send.sh "$_PICKEDCOLOR 3" "$color3\n $_PICKNEXT..." --icon="$FNAME" --expire-time=12000 color4=$($picker_app) FNAME="/tmp/${color4:1:6}.png" - convert -size 100x100 xc:"$color4" "$FNAME" + magick -size 100x100 xc:"$color4" "$FNAME" notify-send.sh "$_PICKEDCOLOR 4" "$color4\n $_PICKEDALL" --icon="$FNAME" --expire-time=12000 fi } @@ -141,7 +142,7 @@ solid() { else get_color fi - magick convert -size "$size" canvas:"$color" "$DIR/$name" + magick -size "$size" canvas:"$color" "$DIR/$name" set_bg } @@ -158,7 +159,7 @@ linear_gradient() { angle=$(yad --center --window-icon=mbcc --title="Linear gradient" --text="\tRotation angle (default is 0):" --width=400 --scale --min-value=0 --max-value=360 --step=45 --enforce-step --inc-buttons) fi name="linear_$name" - magick convert -size "$size" -define gradient:angle="${angle:-0}" gradient:"$color" "$DIR/$name" + magick -size "$size" -define gradient:angle="${angle:-0}" gradient:"$color" "$DIR/$name" set_bg } @@ -181,7 +182,7 @@ radial_gradient() { angle=$(yad --center --window-icon=mbcc --title="Radial gradient" --text="\tRotation angle:" --width=400 --scale --min-value=0 --max-value=360 --step=45 --enforce-step --inc-buttons) fi name="radial_$name" - magick convert -size "$size" -define gradient:extent="${shape:-maximum}" -define gradient:angle="${angle:-0}" radial-gradient:"$color" "$DIR/$name" + magick -size "$size" -define gradient:extent="${shape:-maximum}" -define gradient:angle="${angle:-0}" radial-gradient:"$color" "$DIR/$name" set_bg } @@ -200,7 +201,7 @@ twisted_gradient() { twist=$(yad --center --window-icon=mbcc --title="Radial gradient" --text="\tTwisting amount (default is 150):" --width=400 --scale --value=150 --min-value=0 --max-value=500 --step=20 --inc-buttons) fi name="twisted_$name" - magick convert -size "$size" gradient:"$color" -swirl "${twist:-150}" "$DIR/$name" + magick -size "$size" gradient:"$color" -swirl "${twist:-150}" "$DIR/$name" set_bg } @@ -229,9 +230,9 @@ bilinear_gradient() { name="bilinear_$name" if [[ $answer == "Smooth" ]] || [[ $answer == "S" ]]; then - magick convert \( xc:"$color1" xc:"$color2" +append \) \( xc:"$color3" xc:"$color4" +append \) -append -size "$size" xc: +swap -fx 'v.p{i/(w-1),j/(h-1)}' "$DIR/$name" + magick \( xc:"$color1" xc:"$color2" +append \) \( xc:"$color3" xc:"$color4" +append \) -append -size "$size" xc: +swap -fx 'v.p{i/(w-1),j/(h-1)}' "$DIR/$name" else - magick convert \( xc:"$color1" xc:"$color2" +append \) \( xc:"$color3" xc:"$color4" +append \) -append -filter triangle -resize "$size"\! "$DIR/$name" + magick \( xc:"$color1" xc:"$color2" +append \) \( xc:"$color3" xc:"$color4" +append \) -append -filter triangle -resize "$size"\! "$DIR/$name" fi set_bg } @@ -257,17 +258,17 @@ plasma() { fi name="plasma_$name" if [[ $answer == "r" ]] || [[ $answer == "Random" ]]; then - convert -size "$size" plasma: "$DIR/$name" + magick -size "$size" plasma: "$DIR/$name" elif [[ $answer == "t" ]] || [[ $answer == "Twisted" ]]; then if [[ "$RANDOMIZE" != "true" ]]; then twist=$(yad --center --window-icon=mbcc --title="Plasma" --text="\tTwisting amount (default is 150):" --width=400 --scale --value=150 --min-value=0 --max-value=500 --step=20 --inc-buttons) fi - magick convert -size "$size" plasma:fractal -swirl "${twist:-150}" "$DIR/$name" + magick -size "$size" plasma:fractal -swirl "${twist:-150}" "$DIR/$name" else if [[ "$RANDOMIZE" != "true" ]]; then get_color fi - magick convert -size "$size" plasma:"$color" "$DIR/$name" + magick -size "$size" plasma:"$color" "$DIR/$name" fi set_bg } @@ -280,8 +281,8 @@ blurred_noise() { else { echo; read -p ${ORANGE}"Enter the blur strength (maximum 30): "${BLUE} blur; } fi - magick convert -size "100x56" xc: +noise Random "/tmp/noise.png" - magick convert "/tmp/noise.png" -virtual-pixel tile -blur 0x"${blur:-14}" -auto-level -resize "$size" "$DIR/$name" + magick -size "100x56" xc: +noise Random "/tmp/noise.png" + magick "/tmp/noise.png" -virtual-pixel tile -blur 0x"${blur:-14}" -auto-level -resize "$size" "$DIR/$name" set_bg }