back to swww (2)

This commit is contained in:
end-4
2024-01-23 12:45:22 +07:00
parent 2e1f0509df
commit ea018ac20a
3 changed files with 14 additions and 9 deletions
@@ -7,14 +7,22 @@ else
# Select and set image (hyprland)
cd "$HOME/Pictures"
imgpath=$(yad --width 1200 --height 800 --file --title='Choose wallpaper')
screensizey=$(xrandr --current | grep '*' | uniq | awk '{print $1}' | cut -d 'x' -f2 | head -1)
cursorposx=$(hyprctl cursorpos -j | gojq '.x')
cursorposy=$(hyprctl cursorpos -j | gojq '.y')
cursorposy_inverted=$(( screensizey - cursorposy ))
if [ "$imgpath" == '' ]; then
echo 'Aborted'
exit 0
fi
ags run-js "wallpaper.set('')"
sleep 0.1 && ags run-js "wallpaper.set('${imgpath}')" &
# ags run-js "wallpaper.set('')"
# sleep 0.1 && ags run-js "wallpaper.set('${imgpath}')" &
swww img "$imgpath" --transition-step 100 --transition-fps 60 \
--transition-type grow --transition-angle 30 --transition-duration 1 \
--transition-pos "$cursorposx, $cursorposy_inverted"
fi
# Generate colors for ags n stuff