AVS › AVS Forum › Video Components › Home Theater Computers › HTPC - Linux Chat › Random Wallpaper from interfacelift.com
New Posts  All Forums:Forum Nav:

Random Wallpaper from interfacelift.com

post #1 of 3
Thread Starter 
Here's a script I use to set my wallpaper to a random one from interfacelift.com. Perhaps someone else might find this useful

I am using GNOME on Lucid, so that's the only setup I have tested.

Code:
#!/bin/bash
wget -q -U "Mozilla/5.0" -O - http://interfacelift.com/wallpaper_beta/downloads/random/hdtv/ \\
| grep download.png \\
| sed 's/^\\s*<[^>]\\+download.*$/http:\\/\\/www.interfacelift.com\\1/' \\
| head -n 1 \\
| wget -q -U "Mozilla/5.0" -i - -O wallpaper.jpg.tmp
mv wallpaper.jpg.tmp wallpaper.jpg
touch wallpaper.jpg
This gets the top wallpaper from the Random Wallpaper page on InterfaceLift for a 1080p screen and stores it in wallpaper.jpg file in your home directory. You can change that first URL to whatever you need. -U "Mozilla/5.0" part is important to avoid browser filtering on their website. The touch part triggers the wallpaper update.

Put the script into a file and don't forget to give it execute permissions.
Code:
chmod +x script.sh
Run it once from your home directory

Now set your wallpaper to the wallpaper.jpg file in your home directory.

To make the wallpaper update every set amount of minutes add the following to your cron jobs list. To access it, enter the following in the terminal
Code:
crontab -e
Now add a line like the following
Code:
*/15 * * * * /path/to/script
This will update your wallpaper every 15 minutes. To update every hour, the line should look like this:
Code:
* */1 * * * /path/to/script
Hope this helps.

Edit: added -q flags to wget to prevent a lot of useless stderror from getting sent to the system mail. This, however prevents error messages from getting logged as well.
post #2 of 3
neat-o, thanks!

EDIT: Well, in KDE the jpg in my home dir changes but the wallpaper doesn't until I open up the settings dialog.
post #3 of 3
Thread Starter 
I only tested this under GNOME, sorry. I'm sure there's another way to make it refresh though. Perhaps someone else knows exactly how.
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: HTPC - Linux Chat
AVS › AVS Forum › Video Components › Home Theater Computers › HTPC - Linux Chat › Random Wallpaper from interfacelift.com