Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Random Wallpaper Bash Script

Name: Anonymous 2009-05-02 21:20

Here is my piece of code for that; Nice code?

#!/bin/bash

DIRBG=~/Yo/walls/
PROG=feh
PARAM="--bg-scale"

IFS=$'\x0A'$'\x0D'
MYBG=(`ls "$DIRBG"| sed -e 's/ /\\ /g' | grep -P 'jpe?g|png|gif|bmp$'`)
rnd=$(($RANDOM%${#MYBG[@]}))
$PROG "$PARAM" ${DIRBG}${MYBG[$rnd]}
unset IFS

Name: Anonymous 2009-05-02 22:53

>>1
Did you mean:

/usr/bin/osascript

tell application "System Events"
    set pics to files in folder "walls" of folder "Yo" of home folder ¬
        whose kind ends with "image"
    repeat with d in desktops
        set d's picture to item ¬
            (random number from 1 to count pics) of pics
    end repeat
end tell

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List