Saturday, 13 February 2010

WallpaperChanger.html

Wallpaper Changer
-->

Wallpaper Changer

/ index

Wallpaper changer for Gnome

This is a suite of scripts that scan for pictures and let the user show them on the desktop.

A feature not found in most such programs is that the user can rotate the current wallpaper and have the rotation recorded in the original file (if it still exists of course).

If the current picture is especially pleasing a menu entry lets you add it to a favourites list, if especially displeasing you can add it to a prohibited list and you will never see it again (at least not while it has that full path).

Scrappy notes

At the moment you can add to the favourites list but there is know way to show a picture from it.

There are two obvious ways to do this:

  • add a menu item that picks only from the favourites list,
  • allow the ordinary next command to pick from both lists.

Of course we can provide both methods. In any case we need a way to re-use the code that at the moment picks from the non-favourites list.

At the moment this command not only picks and shows the next wallpaper but handles launching of the scanner that finds new pictures. When picking from favourites we don't need that.

The script to change is chbg-kj-init. This begins by checking the next picture pointer against the number of lines in the picture list. If it is off the end then the list is rebuilt by chbg-kj-init. This must not happen when using the favourites list. Of course we must also pass the name of the list to the script because at the moment it relies on the variable set by chbg-kj-common which will always be the non-favourites list.

The simplest way to fix the function is to add an argument that is the name of the list to pick from. Then inside the check for picture pointer we check to see if the file name is the non-favourites or not. If it is then we re-scan, otherwise we just set the pointer back to the beginning of the list.

We must also maintain two next picture pointers. Again the simplest way to do this is to provide the file name on the command line.

No comments:

Post a Comment

Blog Archive

Followers