Skip to content

Instantly share code, notes, and snippets.

Created May 5, 2012 05:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2600204 to your computer and use it in GitHub Desktop.
Save anonymous/2600204 to your computer and use it in GitHub Desktop.
wallpaper.sh
#!/bin/bash
wallp_dir=/mnt/yandex.disk/wallpapers
reload_time="10"
wallpapers=();
while read ; do
wallpapers+=($REPLY)
done < <(ls "$wallp_dir")
while true; do
count=${#wallpapers[@]}
rand=$((RANDOM % count + 1))
sed -i "s:"${wallp_dir}"/.*.jpg$:"${wallp_dir}"/"${wallpapers[$rand]}":" "${HOME}"/.config/razor/desktop.conf
sleep "$reload_time"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment