Skip to content

Instantly share code, notes, and snippets.

@medzhidov
Created June 1, 2022 19:54
Show Gist options
  • Save medzhidov/365c809102fabcd49fa0eed409f20659 to your computer and use it in GitHub Desktop.
Save medzhidov/365c809102fabcd49fa0eed409f20659 to your computer and use it in GitHub Desktop.
Set live wallpaper with xwinwrap and refresh it every 10 minutes
#!/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