auto change random background in gnome

Nautilus Scripts

Source i (link to git-repo or to original if based on someone elses unmodified work):

Add the source-code for this project on opencode.net

0
Become a Fan
5.0

Description:
This script will auto change background desktop by pictures from one folder after a period time that you set up.
Anyway, you can add many folders contains pictures you want but their path should not has any space character.
Maybe that's too late but I want to share it.
Hope it usefully to you!
Last changelog:

# Verion 0.1 :
# Verion 0.2 :
# Add function "custom options" from command


Ratings & Comments

3 Comments

inameiname

Nice script, but one thing is there is a sleep process that you can't easily turn off as a result of the timer part. And, also, if you run it manually more than once, more than one sleep process that you can't turn off occurs. Anyway, not to condone this script, as it does work just fine, here are a couple I prefer. And they handle spaces in paths and such. ###### Random wallpaper (add whatever wallpaper directory(s) you wish after 'BACKGROUND_DIRS') #!/usr/bin/env python BACKGROUND_DIRS = ['/usr/share/backgrounds', '~/Pictures/Backgrounds'] EXTENSIONS = ['jpeg', 'jpg', 'bmp', 'png', 'svg'] import os, glob, random, itertools, gconf files = list(itertools.chain(*[[os.path.join(dirpath, name) for name in filenames] for dirpath, dirnames, filenames in itertools.chain(*[os.walk(os.path.expanduser(d)) for d in BACKGROUND_DIRS])])) gconf.client_get_default().set_string( '/desktop/gnome/background/picture_filename', random.choice(files)) ###### Automatic wallpaper switcher for Gnome #!/bin/bash if [ $# -ne 2 ];then echo -n "Usage: $0 directory_name timeout_in_seconds Leave the directory name blank for Current Directory For you lazy pal, I assume timeout as 5 sec and Directory as current Do you want to accept this settings? (Y/n): "; read response if [[ "$response" =~ ^[^yY] ]];then exit 0 fi fi function set_wallpaper() { gconftool-2 -s /desktop/gnome/background/picture_options "centered" -t string; gconftool-2 -s /desktop/gnome/background/picture_filename "$1" -t string; } TIMEOUT=${2-5}; WALL_DIR=${1-`pwd`}; echo "Timeout value is: $TIMEOUT"; echo "Directory is: $WALL_DIR"; echo if [ ! -d "$WALL_DIR" ];then echo "The Directory Specified is invalid.."; exit 1; fi filelst="$(find "$WALL_DIR" -type f -name '*.jpg' -o -name '*.png')"; if [ -z "$filelst" ];then echo "No Suitable files found in this location: $WALL_DIR"; exit 1; fi while true;do filename=`echo "$filelst" | shuf -n 1` set_wallpaper "$filename"; sleep $TIMEOUT; done exit

s8dtvt

That's right. Perhaps I will fix it next time. Thanks.

inameiname

Ah. Yeah, it became quite annoying that every time I tried to kill the 'sleep' processes they just kept returning. I had to restart just to get rid of them. hehe

Pling
0 Affiliates
Details
license
version 0.2
updated
added
downloads 24h 0
mediaviews 24h 0
pageviews 24h 0

More Nautilus Scripts from s8dtvt:

Brows - Edit as ROOT
s8dtvt
last update date: 14 years ago

Score 4.7

check path of file in nautilus
s8dtvt
last update date: 14 years ago

Score 5.0

Other Nautilus Scripts:

Gflv2avi
acidc00l
last update date: 15 years ago

Score 5.0

My Movie Portal v3.2.8
iTechScripts
last update date: 13 years ago

Score 4.7

Browse Nautilus as root
SteveSims
last update date: 17 years ago

Score 5.0

Open Nautilus as Root
Mariux
last update date: 17 years ago

Score 5.0

Compare Strings
cdmn
last update date: 17 years ago

Score 5.0

grooto
pontos
last update date: 17 years ago

Score 5.0



System Tags