Created
June 1, 2022 19:54
-
-
Save medzhidov/365c809102fabcd49fa0eed409f20659 to your computer and use it in GitHub Desktop.
Set live wallpaper with xwinwrap and refresh it every 10 minutes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function restartVideo() | |
{ | |
ls /home/ilya/Videos/wallpapers |sort -R |tail -1 |while read file; do | |
# Replace "/home/ilya/Videos/wallpapers/" with your path to folder with videos | |
xwinwrap -fs -fdt -ni -b -nf -- mpv -wid %WID --no-audio --loop "/home/ilya/Videos/wallpapers/$file" > /dev/null 2>&1 & | |
sleep 1 | |
echo $(pgrep -f -P "$!" | grep -o '[[:digit:]]*') | |
done | |
} | |
while true; do | |
xwinPID=$(restartVideo) | |
sleep 600 | |
kill $xwinPID | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment