Skip to content

Commit 0ac0b0f

Browse files
committed
make logo effects more scalable + add more options
1 parent 4a4137e commit 0ac0b0f

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

wallutils.sh

+11-13
Original file line numberDiff line numberDiff line change
@@ -142,18 +142,17 @@ compwallpaper() {
142142
instantoverlay
143143
imgresize overlay.png "$RESOLUTION"
144144

145-
# perpare effects
146-
case $(iconf logoeffects) in
147-
"invert")
148-
convert wall.png -channel RGB -negate effect.png
149-
;;
150-
"blur")
151-
convert wall.png -blur 100x100 effect.png
152-
;;
153-
"both")
154-
convert wall.png -blur 100x100 -channel RGB -negate effect.png
155-
;;
156-
esac
145+
# perpare effect settings
146+
iconf logoeffects | grep swirl && EFFECTS+=("-swirl" "360")
147+
iconf logoeffects | grep flip && EFFECTS+=("-flip")
148+
iconf logoeffects | grep blur && EFFECTS+=("-blur" "100x100")
149+
iconf logoeffects | grep invert && EFFECTS+=("-channel" "RGB" "-negate")
150+
iconf logoeffects | grep grayscale && EFFECTS+=("-colorspace" "Gray")
151+
iconf logoeffects | grep contrast && EFFECTS+=("-level" "20000")
152+
iconf logoeffects | grep dim && EFFECTS+=("-modulate" "50")
153+
iconf logoeffects | grep brighten | grep -v dim && EFFECTS+=("-modulate" "150")
154+
155+
convert wall.png "${EFFECTS[@]}" effect.png
157156

158157
# create mask from overlay
159158
convert overlay.png -alpha extract mask.png
@@ -165,7 +164,6 @@ compwallpaper() {
165164
rm wall.png
166165
rm mask.png
167166
rm cut.png
168-
rm blackandwhite.png
169167
rm effect.png
170168
else
171169
echo "logo disabled"

0 commit comments

Comments
 (0)