diff options
| author | littleblack111 <jerrylam110209@gmail.com> | 2023-07-23 09:14:34 +0800 |
|---|---|---|
| committer | littleblack111 <jerrylam110209@gmail.com> | 2023-07-23 09:14:34 +0800 |
| commit | 9b8128a9342500fa4dd43331bd2eb6c8b4ed9b07 (patch) | |
| tree | adda4f289032db1e3847b766112e83a5141116f3 /wallpapertrans.sh | |
| parent | b8aa6b6a516ac4ae5a104d7de96f31ced7f16d55 (diff) | |
updated
Diffstat (limited to 'wallpapertrans.sh')
| -rwxr-xr-x | wallpapertrans.sh | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/wallpapertrans.sh b/wallpapertrans.sh new file mode 100755 index 0000000..bc4f523 --- /dev/null +++ b/wallpapertrans.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# Animated wallpaper changer +feh --bg-fill ~/.cache/wallpaper/old.jpg + + +DISPLAY=:0 +WALLPAPERS="$HOME/Pictures/wallpapers/" +#wallpappath=( `"find "$WALLPAPERS" | shuf -n 1"` ) +wallpappath=$(find "$WALLPAPERS" | shuf -n 1) +echo "$wallpappath" > "$HOME/.cache/current.bg" + +# polybar bg theme +# forground experiment is bad +#if [[ $(bgthemecheck.sh) == "dark" ]]; then +# sed -i 's/^\*.bgcolor*$/\*.bgcolor: #C7242931/g' "$HOME"/.Xresources +#elif [[ $(bgthemecheck.sh) == "light" ]]; then +# sed -i 's/^\*.bgcolor*$/\*.bgcolor: #C7FFFFFF/g' "$HOME"/.Xresources +#else +# printf "An error had occured during apply theme to polybar" +#fi + +DELAY=0.01 +QUALITY=0.3 +RESIZE=30% + +echo $# + +if [ $# -ne 1 ]; then + convert ~/.cache/wallpaper/old.jpg -resize $RESIZE -fill black -blur 10% -fill black -colorize 10% -quality $QUALITY /tmp/transition1.jpg + convert ~/.cache/wallpaper/old.jpg -resize $RESIZE -fill black -blur 20% -fill black -colorize 20% -quality $QUALITY /tmp/transition2.jpg + convert ~/.cache/wallpaper/old.jpg -resize $RESIZE -fill black -blur 35% -fill black -colorize 35% -quality $QUALITY /tmp/transition3.jpg + convert ~/.cache/wallpaper/old.jpg -resize $RESIZE -fill black -blur 50% -fill black -colorize 50% -quality $QUALITY /tmp/transition4.jpg + convert ~/.cache/wallpaper/old.jpg -resize $RESIZE -fill black -blur 75% -fill black -colorize 75% -quality $QUALITY /tmp/transition5.jpg + convert ~/.cache/wallpaper/old.jpg -resize $RESIZE -fill black -blur 100% -fill black -colorize 100% -quality $QUALITY /tmp/transition6.jpg + + convert "$wallpappath" -resize $RESIZE -fill black -blur 75% -fill black -colorize 75% -quality $QUALITY /tmp/transition7.jpg + convert "$wallpappath" -resize $RESIZE -fill black -blur 50% -fill black -colorize 50% -quality $QUALITY /tmp/transition8.jpg + convert "$wallpappath" -resize $RESIZE -fill black -blur 35% -fill black -colorize 35% -quality $QUALITY /tmp/transition9.jpg + convert "$wallpappath" -resize $RESIZE -fill black -blur 20% -fill black -colorize 20% -quality $QUALITY /tmp/transition10.jpg + convert "$wallpappath" -resize $RESIZE -fill black -blur 10% -fill black -colorize 10% -quality $QUALITY /tmp/transition11.jpg + + feh --bg-fill /tmp/transition1.jpg + sleep $DELAY + feh --bg-fill /tmp/transition2.jpg + sleep $DELAY + feh --bg-fill /tmp/transition3.jpg + sleep $DELAY + feh --bg-fill /tmp/transition4.jpg + sleep $DELAY + feh --bg-fill /tmp/transition5.jpg + sleep $DELAY + feh --bg-fill /tmp/transition6.jpg + sleep $DELAY + + feh --bg-fill /tmp/transition7.jpg + sleep $DELAY + feh --bg-fill /tmp/transition8.jpg + sleep $DELAY + feh --bg-fill /tmp/transition9.jpg + sleep $DELAY + feh --bg-fill /tmp/transition10.jpg + sleep $DELAY + feh --bg-fill /tmp/transition11.jpg + sleep $DELAY + + rm /tmp/transition* +fi + +feh --bg-fill "$wallpappath" + +cp "$wallpappath" ~/.cache/wallpaper/old.jpg + |
