After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 31319 - random background
random background
Status: RESOLVED OBSOLETE
Product: gnome-tweak-tool
Classification: Applications
Component: general
unspecified
Other other
: Low enhancement
: ---
Assigned To: GNOME Tweak Tool maintainer(s)
GNOME Tweak Tool maintainer(s)
: 58949 87635 138939 169172 338410 341768 570685 637773 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2000-11-09 00:40 UTC by marillat.christian
Modified: 2018-01-24 14:59 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement



Description marillat.christian 2001-01-27 20:08:14 UTC
Package: gnome-core
Version: 1.2.3.1
Severity: wishlist

>Originator: 	 Christian Marillat
>Organization:
net
>Synopsis:	
>Class:		
>Gnome-Libs-Release: gnome-libs-1.2.8
>Environment:
    	
System: Linux falcon.wanadoo.fr 2.2.17 #1 dim oct 1 16:10:29 CEST 2000 i686 unknown
Architecture: i686

Distribution: Debian Version: woody

>Description:
Hi,

it would be cool if i could point gnome to a directory of graphics and it
chooses a random background on each startup...




------- Bug moved to this database by debbugs-export@bugzilla.gnome.org 2001-01-27 15:08 -------
This bug was previously known as bug 31319 at http://bugs.gnome.org/
http://bugs.gnome.org/show_bug.cgi?id=31319
Originally filed under the gnome-core product and general component.

Unknown version 1.2.x in product gnome-core. Setting version to the default, "unspecified".
The original reporter (marillat.christian@wanadoo.fr) of this bug does not have an account here.
Reassigning to the exporter, debbugs-export@bugzilla.gnome.org.
Reassigning to the default owner of the component, gnome-core-maint@bugzilla.gnome.org.

Comment 1 Chema Celorio 2001-09-15 19:11:48 UTC
Changing the version number because this wishlist item is still valid.
Comment 2 Bradford Hovinen 2001-10-13 00:25:53 UTC
The user interface for this is a bit tricky; if we are going to do
this I'll have to consult a UI designer. It would not be *too*
difficult to implement this without a UI.
Comment 3 Luis Villa 2002-01-23 22:21:55 UTC
*** Bug 58949 has been marked as a duplicate of this bug. ***
Comment 4 Luis Villa 2002-04-10 02:51:53 UTC
Updating all cc bugs that have the GNOME2 keyword set to the GNOME2.0 milestone,
to help jrb triage/prioritize cc bugs. Filter on 'luis doing GNOME2 work' to
ignore this spam.
Comment 5 Chema Celorio 2002-06-20 05:45:21 UTC
I agree with this feature. Would be nice to have althought it will
make the interface not as easy to use.
Comment 6 Luis Villa 2002-07-09 01:16:21 UTC
*** Bug 87635 has been marked as a duplicate of this bug. ***
Comment 7 Luis Villa 2002-11-07 14:37:03 UTC
SPAM as discussed last night. Search for 'SPAM as discussed last night' to catch
these all and delete them. :) 
Comment 8 Ben FrantzDale 2002-12-07 01:24:37 UTC
Does Nautilus use FAM to monitor it's background file?
If so, one could point nautilus to a file and then write a script to
change it every so often.

It wouldn't be for beginners, but that would at least work.
Comment 9 Andrew Sobala 2003-02-11 18:10:36 UTC
Hacky, though, Ben :)
Comment 10 Arcterex 2003-06-06 16:52:37 UTC
The UI in mac os/x does this quite nicely, and although it'd have to
be adapted a bit, I think it could be worked in nicely.  Basically
(and I'm going from memory here), you have a drop down of the types of
backgrounds you get to choose from (nature, abstract, animals) and
when that is selected you get shown a list of NN images thumbnailed
that can be chosen as a background.  Below that there's a checkbox
with "rotate background images".  This applies to whatever background
set you have (I believe that "all" is an option in the background sets).

Personally I think that the addition of a checkbox and browse button
at the bottom of the backgrounds capplet (labeled something like
"rotate through images in this directory" or something like that) with
hidden gconf keys for duration (default of 10 min?) and recurse
through subdirs (off by default).

Not sure how the usability team thinks of this, but it'd be a nice
feature to add so that I can get rid of my chgbg.pl script :)
Comment 11 Rodney Dawes 2004-04-03 15:39:52 UTC
*** Bug 138939 has been marked as a duplicate of this bug. ***
Comment 12 Vincent Untz 2005-03-04 09:14:03 UTC
*** Bug 169172 has been marked as a duplicate of this bug. ***
Comment 13 Christian Kirbach 2005-03-05 23:05:29 UTC
Raising the version number because this wishlist item is still valid.
Comment 14 Kristof Vansant 2005-07-25 21:27:36 UTC
isn't it better to have this handled by an other program since it is an option
that not a lot of users will use/need.

adding more options will decrease usability

I don't know if control center makes it easy for third party apps to change the
background.
Comment 15 Jonas De Vuyst 2005-12-24 16:54:10 UTC
Meanwhile the following script will change your background to a random image from the list in gnome-background-properties. The 'grep -A6' should make it fairly robust. You could add it to your cron or set it to run at startup (though adding it to gnome-session startup will make GNOME no longer boot; delete the entry from ~/.gnome2/session-manual if you run into this problem).

#!/bin/sh
t=`grep -A6 '<wallpaper deleted="false">' ~/.gnome2/backgrounds.xml \
        | grep '<filename>' \
        | sed 's#[^<>]*<filename>##' \
        | sed 's#</filename>[^<>]*##' \
        | grep -v '(none)'`

c=`echo "$t" | wc -l`
((p=($c+1)*$RANDOM/32767))

f=`echo "$t" | head -n$p | tail -n1`
gconftool --type=string -s /desktop/gnome/background/picture_filename "$f"
Comment 16 Jason D. Hildebrand 2006-01-31 06:04:14 UTC
I've been thinking about this feature, too.  There is a proliferation of scripts out there to change your background (I've written a few myself), so it's obvious that people want this.

I'm not sure that we necessarily need "categories" of wallpapers like OS X does -- why not simply use the list of wallpapers that the user has currently put into the dialog?  

One of the problems with many existing scripts that choose a random file from a directory is that some images need to be scaled, whereas others need to be stretched.  In other words, it's best if the user can choose this setting specific to each image.  Luckily the existing UI already does this, and saves the settings to an XML file.

In terms of implementation, my thought is that cron would be well-suited for changing the background.  Most distros come with this capability; we could sniff to see if cron is available, and if so, display the following line at the bottom of the existing dialog:

 [X] Change wallpaper every [hour]  (where [hour] is a dropdown with several time intervals.

If the box is checked, you add a job to the user's crontab, with a marker embedded in a comment so it can be found an removed automatically if the user later unchecks the box.

I've written a python script which reads the existing XML file and changes the background via gconf.  It probably needs to be rewritten in C to reduce dependencies, but here it is for reference:

#!/usr/bin/env python

import os
import sys
import random
from xml.dom import minidom

def getTag(wallpaper, tag):
    tag = wallpaper.getElementsByTagName(tag)
    tag = tag[0]
    child = tag.firstChild
    assert child.nodeType == child.TEXT_NODE
    return child.data.strip()

def setGconfKey(key, value):
    os.system('gconftool-2 -t str -s "%s" "%s"' % (key, value))

def setRandomWallpaper():
    xmldoc = minidom.parse(os.path.expanduser('~/.gnome2/backgrounds.xml'))
    wallpapers = xmldoc.getElementsByTagName('wallpaper')
    wallpapers = filter(lambda w: w.attributes['deleted'].value == 'false', wallpapers)

    while 1:
        if not wallpapers:
            # nothing to do
            sys.exit(0)
        selection = random.choice(wallpapers)
        if not os.path.exists(getTag(selection, 'filename')):
            # image file doesn't exist; remove entry from list and try again
            wallpapers.remove(selection)
        else:
            setGconfKey('/desktop/gnome/background/picture_filename', getTag(selection, 'filename'))
            setGconfKey('/desktop/gnome/background/picture_options', getTag(selection, 'options'))
            break

if __name__ == "__main__":
    setRandomWallpaper()


Comment 17 Olav Vitters 2006-01-31 08:13:18 UTC
Another application that does this and also supports settings a different background per workspace:
  Wallpapoz - http://wallpapoz.sourceforge.net/

Listed on:
  http://live.gnome.org/PowerUserTools
Comment 18 Olav Vitters 2006-04-14 10:34:23 UTC
*** Bug 338410 has been marked as a duplicate of this bug. ***
Comment 19 Olav Vitters 2006-05-14 21:58:04 UTC
*** Bug 341768 has been marked as a duplicate of this bug. ***
Comment 20 Alexander van Loon 2006-05-15 19:29:01 UTC
quoting Kristof Vansant: "adding more options will decrease usability"

A lack of features isn't usable either. It's just how you interpret usability.



Really, is adding one checkbox to turn on auto changing in the Background Preferences that much of a problem, usability wise? Of course, it's not essential at all, but it would be convenient if the feature would be available.

And downloading extra software for this functionality doesn't seem like an optimal solution to me. All you need is a single checkbox for turning it on in the Background Preferences, IMO.
Comment 21 Pacho Ramos 2007-11-25 00:13:55 UTC
Would be nice implement this for upcoming gnome versions :-)

Thanks
Comment 22 Robert Carboneau 2009-05-30 23:45:27 UTC
Well, as of Windows 7, this feature is now supported by pretty much everybody else but GNOME. At what point does a feature change from being confusing by its presence, to being confusing by its absence?
Comment 23 antistress 2009-08-17 23:36:40 UTC
Although i'm also looking for that feature (random background on each startup) and not for the one in Bug 570685 (Change wallpapers every X minutes) which may concern less users, i guess that mockups for GUI implementation could be shared between that é reports
Comment 24 antistress 2009-08-17 23:42:51 UTC
Please note that, as far as i'm concerned, i didn't need that feature (random background on each startup) until i get a netbook.
A netbook (or a laptop) is like a phone : you use it in public and while your leisures and you pay more attention to that details.
If i'm right, since people use more and more netbooks and laptops, that feature could be more and more wanted
Comment 25 Bastien Nocera 2011-03-17 14:00:28 UTC
We won't be adding tools to create slideshows, or random backgrounds, as there
are already applications that do this kind of thing quite well, and their UIs
are clearly focused around that. For example, Wallpaper gallery at
http://www.olmec.co.nz/
Comment 26 antistress 2012-09-29 06:05:20 UTC
In my experience, toying with the wallpaper is one of the top things that beginners do.
Regarding their computer competence, can we seriously ask them to install an application for that ?
Or could we imagine adding a tick under the wallpaper chooser that would basically say : "Change wallpaper on every startup choosing an image randomly"
Comment 27 Gian Mario Tagliaretti 2015-09-13 09:13:08 UTC
*** Bug 637773 has been marked as a duplicate of this bug. ***
Comment 28 Gian Mario Tagliaretti 2015-09-13 09:15:30 UTC
*** Bug 570685 has been marked as a duplicate of this bug. ***
Comment 29 GNOME Infrastructure Team 2018-01-24 14:59:43 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnome-tweaks/issues/1.