2019-11-27, 16:29
Hi all,
I really love this skin and I liked the wallpapers that were already available but I thought it'd be cool to download some others at a specified period so i created a bash script that does exactly that (sort of).
Save this to a file "myscript.sh"
Then open a command prompt and make it executable
copy the file to the path with all the pellucid wallpapers (I'm using openelec): /storage/.kodi/addons/skin.pellucid/extras/homeBackgrounds/
Then use crontab to run the script at a specified interval. You *could* put a sleep command in the script but that's a bit rubbish...
Open a command prompt and ssh in to the kodi box
ssh root@IP_OF_KODI
password: openelec
Type "crontab -e" and press Enter
My input is 9am every day of every month of every year:
0 9 * * * /storage/.kodi/addons/skin.pellucid/extras/homeBackgrounds/myscript
Ctrl+O to save and Enter to confirm
Ctrl+X to exit.
That's it! It'll download a new wallpaper every day to add to your collection. It will do that forever so maybe I'll add a "delete oldest image" after a set time too. But this is enough for me now.
Let me know your thoughts,
Cheers.
I really love this skin and I liked the wallpapers that were already available but I thought it'd be cool to download some others at a specified period so i created a bash script that does exactly that (sort of).
bash:
#/bin/bash
name=wallpaper
if -e $name.jpg (wiki) ; then
i=0
while -e $name-$i.jpg (wiki) ; do
let i++
done
name=$name-$i
fi
touch "$name".jpg
wget -O "$name".jpg https://unsplash.it/1920/1080/?random
Save this to a file "myscript.sh"
Then open a command prompt and make it executable
Code:
chmod +x myscript.sh
copy the file to the path with all the pellucid wallpapers (I'm using openelec): /storage/.kodi/addons/skin.pellucid/extras/homeBackgrounds/
Then use crontab to run the script at a specified interval. You *could* put a sleep command in the script but that's a bit rubbish...
Open a command prompt and ssh in to the kodi box
ssh root@IP_OF_KODI
password: openelec
Type "crontab -e" and press Enter
My input is 9am every day of every month of every year:
0 9 * * * /storage/.kodi/addons/skin.pellucid/extras/homeBackgrounds/myscript
Ctrl+O to save and Enter to confirm
Ctrl+X to exit.
That's it! It'll download a new wallpaper every day to add to your collection. It will do that forever so maybe I'll add a "delete oldest image" after a set time too. But this is enough for me now.
Let me know your thoughts,
Cheers.