1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-23 11:21:50 +08:00
dotfiles/.config/sway/scripts/update-wallpaper.sh

21 lines
495 B
Bash
Raw Normal View History

2023-03-07 15:11:17 +08:00
#!/bin/sh
export PATH="${PATH}:${HOME}/.local/bin"
export XDG_RUNTIME_DIR=/run/user/1000
export XDG_CACHE_HOME=$HOME/.cache
2023-07-16 09:49:32 +08:00
# If not using sway, we exit
if ! pidof sway > /dev/null
then
exit
fi
# If the deamon starts first time, we only init it, and the wallpaper will be updated
2023-03-07 15:11:17 +08:00
if ! pidof swww-daemon > /dev/null
then
2023-07-16 09:49:32 +08:00
swww init
exit
2023-03-07 15:11:17 +08:00
fi
swww img $(find -L ~/.config/sway/Wallpaper/ -type f | shuf -n1) -t wave --transition-fps 60 --transition-duration 5 --transition-wave 16,16