1
1
mirror of https://github.com/rywng/dotfiles.git synced 2024-11-23 03:11:49 +08:00
dotfiles/.config/sway/scripts/update-wallpaper.sh
2023-07-16 09:49:32 +08:00

21 lines
495 B
Bash
Executable File

#!/bin/sh
export PATH="${PATH}:${HOME}/.local/bin"
export XDG_RUNTIME_DIR=/run/user/1000
export XDG_CACHE_HOME=$HOME/.cache
# 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
if ! pidof swww-daemon > /dev/null
then
swww init
exit
fi
swww img $(find -L ~/.config/sway/Wallpaper/ -type f | shuf -n1) -t wave --transition-fps 60 --transition-duration 5 --transition-wave 16,16