The Daily Static
  The Daily Static
UF Archives
Register
UF Membership
Ad Free Site
Postcards
Community

Geekfinder
UFie Gear
Advertise on UF

Forum Rules
& FAQ


Username

Password


Create a New Account

 
 

Back to UserFriendly Strip Comments Index

Rotating wallpaper in Ubuntu by Kickstart 2005-05-03 10:09:54
Just figured I'd post this mini-script for anyone's benefit:
#!/bin/sh

# Wallpapers location
wploc='/home/greg/images/wallpapers/'
cd $wploc

FILENAMES=( `find $wploc -maxdepth 1 -iname '*.jpg'|tr '\n' ' '` )

# Count wallpapers
N=${#FILENAMES[@]}-1

# Pick a random wallpaper number
NUM=$(($RANDOM % $N + 1));

# Set wallpaper
# echo "$wploc$BGNAME"
gconftool-2 -t str --set /desktop/gnome/background/picture_filename "${FILENAMES[$NUM]}"

# Set tiling parameters
gconftool-2 -t str --set /desktop/gnome/background/picture_options "stretched"
#Possible values are "none", "wallpaper" (eg tiled), "centered", "scaled", "stretched"

This is based on someone else's script on the Ubuntu forums that really doesn't work worth a $!*&.

KS

[ Reply ]
  Don't need that in OS X :P (n/t) by dodrian2005-05-03 10:16:46
    Don't need to support M$ to get it, either ;) (n/t by Kickstart2005-05-03 10:21:38
      eh? (n/t) by pverdon2005-05-03 13:42:01

 

[Todays Cartoon Discussion] [News Index]

Come get yer ARS (Account Registration System) Source Code here!
All images, characters, content and text are copyrighted and trademarks of J.D. Frazer except where other ownership applies. Don't do bad things, we have lawyers.
UserFriendly.Org and its operators are not liable for comments or content posted by its visitors, and will cheerfully assist the lawful authorities in hunting down script-kiddies, spammers and other net scum. And if you're really bad, we'll call your mom. (We're not kidding, we've done it before.)