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

I'm a fucking idiot.

Name: Anonymous 2009-05-11 8:22

Sup /prog/. bash noob here, and I need some help getting a short script of mine working.

#!/bin/bash

cd ~/wallpapers

while [ 1 ]
do
n=$(ls |sort -R |tail -1)
gconftool-2 --type string --set /desktop/gnome/background/picture_filename $n
sleep 5 m
done

I've done debugging with echo, so I know that the file names are correct. One thing that I also checked, that didn't help, was changing the "$n" line to the absolute path, "~/wallpapers/$n", with no luck. I also played around with quotation marks, and still, no luck. No matter what I do, it changes the background to a flat brown.

When I run the command

gconftool-2 --type string --set /desktop/gnome/background/picture_filename "~/wallpapers/example.jpg"

it works correctly.


I'm running Ubuntu Intrepid, not sure if that helps at all.

Thanks in advance.

Name: Anonymous 2009-05-11 10:51

>>2
Thanks, shuf -n1 was just what I needed.

>>3
I guess I should have specified that I am retarded, hence the shit like cd ~/wallpapers, etc.

>>4
So you're saying use find $HOME/wallpapers/* | shuf -n1, right?

>>5

Don't know how to do that.

I suppose starting with the title of "I am an idiot" gave myself too much credit, huh?

Anyways, thanks guys, you were great.

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