diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2024-10-02 21:24:10 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2024-10-02 21:24:10 +0800 |
| commit | b57f97764584ad850b3d98a33f3482bb0c34d462 (patch) | |
| tree | c58546072ca699ad55cfc4201290b900b942fba2 | |
| parent | 1c1bf229caba0fb4ba9e09f5f74218c07bb7920a (diff) | |
feat(mpvpaper,transition): added swww as transition
remove(mpvpaper,debug): removed debug message
| -rwxr-xr-x | mpvpaper.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/mpvpaper.sh b/mpvpaper.sh index e733892..3bca430 100755 --- a/mpvpaper.sh +++ b/mpvpaper.sh @@ -3,6 +3,7 @@ XDG_VIDEOS_DIR="${XDG_VIDEOS_DIR:-$HOME/Videos}" XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}" XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}" WALLPAPERS="$XDG_VIDEOS_DIR/wallpapers/" +swwwarg="--transition-type random --transition-duration 0.85 --transition-fps 160 --transition-bezier 1,0.33,0.3,1" # colors RED='\033[0;31m' @@ -12,6 +13,7 @@ NC='\033[0m' DELAY=1800 while true; do + (while ! swww query; do swww-daemon; done) & current_bg="$(cat $XDG_CACHE_HOME/current.bg)" if ! [ "$current_bg" ]; then echo -e "${RED}current.bg not set, regenerating it${NC}" @@ -21,20 +23,23 @@ while true; do fi wallpappath=$(find "$WALLPAPERS" | shuf -n 1) + if [ ! -f "$XDG_CACHE_HOME/$(basename "$current_bg").png" ]; then ffmpeg -hwaccel cuda -i "$current_bg" -y "$XDG_CACHE_HOME/$(basename $current_bg).png"; fi + # wallust run --skip-sequences $current_bg # wallust run --backend kmeans --skip-sequences $current_bg & # using cache now killall mpvpaper + swww img "$XDG_CACHE_HOME/$(basename "$current_bg").png" $swwwarg # for output in $(hyprctl monitors | grep "Monitor" | awk '{print $2}'); do # mpvpaper --auto-pause --mpv-options="hwdec=auto --no-audio --loop" --fork "$output" "$current_bg" mpvpaper --auto-pause --mpv-options="hwdec=auto --no-audio --loop" --fork "*" "$current_bg" # done - wallust run --backend full --skip-sequences "$XDG_CACHE_HOME/$(basename $current_bg).png" & - echo "$XDG_CACHE_HOME/$(basename $current_bg).png" + wallust run --backend full --skip-sequences "$XDG_CACHE_HOME/$(basename "$current_bg").png" & + echo "$XDG_CACHE_HOME/$(basename "$current_bg").png" swaync-client --reload-css - prime-run ffmpeg -hwaccel cuda -i "$current_bg" -y "$XDG_CACHE_HOME/bg.png" & + prime-run ffmpeg -hwaccel cuda -i "$current_bg" -y "$XDG_CACHE_HOME/bg.png" current_bg=$(cat "$XDG_CACHE_HOME/current.bg") echo "$wallpappath" > "$XDG_CACHE_HOME/current.bg" |
