EDIT: Sep-28-2010 : as of a while ago 1x.com changed how their random images are served so this script no longer works. i’ll see if i can use a different site as pointed out in the comments.

so after creating the evilwm random wallpaper script i decided that i wanted to use the fixed resolution images from 1x.com.

here is the script i made up with an explanation below:


if [ -d /tmp/jpg/ ];
    echo dir exists
    mkdir /tmp/jpg/

if [ -f /tmp/jpg/1x.txt ];
    echo file exists
    touch /tmp/jpg/1x.txt

while :;do
    FILENAME=`cat /tmp/jpg/1x.txt | egrep random | egrep main | egrep jpg | cut -d\" -f32 | cut -d= -f2 | cut -d\& -f1`
    curl --silent http://1x.com/photo/random/ > /tmp/jpg/1x.txt
    wget http://imghost.1x.com/${FILENAME} -O /tmp/jpg/${FILENAME} > /dev/null 2>&1
    #/usr/bin/feh --bg-center /tmp/jpg/${FILENAME}
    #xv -quit -root -rmode 5 -max /tmp/jpg/${FILENAME}
    sleep 60

all this script does is gets the html from http://1x.com/photo/random/, cuts it accordingly to grab the jpg name and then wget’s the proper jpg.
make sure to uncomment either the feh line or xv line according to tastes.

you can also change the sleep interval if you want to make it shorter or longer.

The following two tabs change content below.

Latest posts by cesar (see all)

2 comments so far

Add Your Comment
  1. Hello, 1x.com is a dictatorial site ! you should use photo.net instead !!!
    They are using a very insane way of selecting photos and the way they “big brother” the comments and forum is an indication of how insane they are !!
    boycott this site and use pbase, fotocommunity, fotoblur etc. isntead !

    • cool – ill start working on a script to use photo.net. thanks for the recommendation.