Zolved community solution Createarticle_iconnew articleEditarticle_iconedit article

How to change Desktop background on Ubuntu

Let's learn how to change the Desktop background by selecting a wallpaper of our choice in Ubuntu.

Want to make your Ubuntu Desktop look fashionable? Then follow these steps.

Changing the Background:

  • Go to System > Preferences > Desktop Background
        
  • Or else right click on desktop and in the screen that appears, click Change Desktop Background as show in the figure.

        
  • Desktop Background Preferences window is shown. Select a wallpaper from the list or else add a new wallpaper using Add Wallpaper button and click on Finish. The  selected wallpaper will be shown as Desktop background. You can even tile, stretch center or have a border color of your choice.

            

Changing the Background as needed using basic commands

  • Go to Applications > Accessories > Terminal
        
  • Use the below basic commands to change the picture (or color) as needed.

         $ gconftool-2 -t str --set /desktop/gnome/background/picture_filename /path/picture.gif (Change Picture)

        $ gconftool-2 -t str --set /desktop/gnome/background/primary_color "#AABBCC" (Change Primary color)

         $ gconftool-2 -t str --set /desktop/gnome/background/secondary_color "#112233"

               

  • Colors are represented by three hex bytes that denote red, green, and blue. Black is #000000, white is #FFFFFF, and a nice light blue is #2255FF.


Informative Colors using Perl

  • Go to Applications > Accessories > Text Editor
        
  • Copy the below code and paste it in the Text Editor to change the background color every 15 seconds based on the system load

        

	#!/usr/bin/perl

	# Color the background based on system load

	my $Key = "/desktop/gnome/background/primary_color";

	my $Load; # system load

	my $R, $G, $B; # Red, Green, Blue colors

	while ( 1 )

	   {

		$Load=`uptime`; # get the current load

		# format is "time duration, users, load average: 0.00, 0.00, 0.00"

		# remove everything except the first load value

		$Load =~ s/.*: //;

		# load values: 1 minute, 5 minute, 15 minute averages

		# these are colored: 1=Red, 5=Green, 15=Blue

		($R,$G,$B) = split(', ',$Load);

		# scale up to the range 0-255, but cap it at 255

		$R = $R * 255; if ($R > 255) { $R = 255; }

		$G = $G * 255; if ($G > 255) { $G = 255; }

		$B = $B * 255; if ($B > 255) { $B = 255; }

		# convert to hex

		$Load = sprintf "%02X%02X%02X",$R,$G,$B;

		# set the color

		system("gconftool-2 -t str --set $Key '#$Load'");

		sleep 15; # Update 4 times per minute

	}

 

       
  • Save this text file (Ctrl+s) or click on Save button, choose the destination, name the file and save it.

             
  • Browse the folder where this text file is saved and Execute the file using the below command

               $ perl color.pl

        

This script will change the background color every 15 seconds based on the system load. A reddish color indicates that the system is very active. Yellow indicates an active process that has been running at least 5 minutes; white means at least 15 minutes. If no processes are raising the system load, then the colors will cycle from green to blue to black.






copyright © 2007, IPTouch, Inc.

 

 

Comments
  • Posted by: asdf_6333 at 10 Jul 03:46 permalink
    Here is an interesting post about how you can have a slideshow as your ubuntu desktop background:

    http://abhishek-myspace.blogspot.com/2007/07/slideshow-on-kdesktop-background.html