I have been using fedora with gnome 3 for many months.Even though GNOME 3 is a great release,its has some rough edges too.In this example I will explain how to change the wallpaper in regular interval(say 1 minute interval).Here I am using perl script to accomplish my goal.You can also use python to do the same.Following are the steps
- Create a directory(ex: /home/senan/wallpaper) and copy all the images to it or you can use the default wallpaper directory
- we will store the image names in array
- Then we will pick an image randomly and set it as wallpaper using gsettings every 10 seconds
use the following perl script to do the above things
#!/usr/bin/perl -w # # Author : Prabhendu V Senan # Description : This is a perl script for changing the Gnome wallpaper in a specified time interval # File Name : change_wall.pl # # Directory containing the wallpaper images $wallDir = '/home/senan/wallpaper'; # Wallpaper change interval time $interval = 10; # First check whether the directory containing images exists or not unless(-d $wallDir) { print "There is no such $wallDir directory \n"; exit(); } # Parse the directory,get all the image filenames and fill it into an array @images = `find $wallDir -type f | grep [jJ]*[pP][nN]*[eE]*[gG]`; chomp(@images); #if the directory has no images,Exit() if(@images == 0) { print "No Images found in $wallDir \n"; exit(); } my $nowShowin; while(1) { $nowShowing = $images[rand(@images)]; `gsettings set org.gnome.desktop.background picture-uri "file:///$nowShowing"`; sleep($interval); }
To run the script: Copy and paste it into your favourite text editor.
- Save the file(ex:wallChange.pl
- Make it executable(ex: chmod +x wallChange.pl)
- CD to script dir and run the script :-)
- To run the script during start up:Open gnome-session-properties->Add->Browse the script and add :-)
- Restart your computer