Add a image to the list of background files in gnome
| Hot: |
In Gnome, when you right click on the desktop background you will get a menu for “Change Desktop backgound. The images displayed in this menu are quite a few but if you want to add your own (read: more than some 5-6 files) then it takes really some time in using the GUI to add them. And if you want to add a few 10’s of file, like say 50 then you are done.
So I wrote a simple script to add the images to the menu from command line. This was a quick script so no checks done, use at your own risk and after taking backup of related files
#Remove the last line from the file.
sed -n ‘$!p’ ~/.gnome2/backgrounds.xml > /tmp/outfile
mv /tmp/outfile ~/.gnome2/backgrounds.xml#Start adding the wallpaper
echo “<wallpaper deleted=\”false\”>” >> ~/.gnome2/backgrounds.xml
echo “ <name>$1</name>” >> ~/.gnome2/backgrounds.xml
echo “ <filename>” >> ~/.gnome2/backgrounds.xml
echo “`pwd`/$1″ >> ~/.gnome2/backgrounds.xml
echo “</filename>” >> ~/.gnome2/backgrounds.xml
echo “ <options>zoom</options>” >> ~/.gnome2/backgrounds.xml
echo “ <shade_type>solid</shade_type>” >> ~/.gnome2/backgrounds.xml
echo “ <pcolor>#76848F</pcolor>” >> ~/.gnome2/backgrounds.xml
echo “ <scolor>#142C3D</scolor>” >> ~/.gnome2/backgrounds.xmlecho “ </wallpaper>” >> ~/.gnome2/backgrounds.xml
#Add the last line again
echo “</wallpapers>” >> ~/.gnome2/backgrounds.xml
Originally posted 2008-11-15 10:12:16.
related post
- My Images
- BDay Snaps
- Nature
- Get the information on all the rpms installed on the system
- Python program to download youtube video -- written by Ricardo Garcia Gonzalez
Related Posts -
Use GIMP to create awesome looking collage in minutes Here is an example to begin with: I will make... -
Mount and unmount/umount images(iso/img) from nautilus (Fixed not mounting in Fedora) Get the Nautilus Script here. So what is required is...
Related Websites - Change your look, add effects to your photos - Cutom Image Masking with MaskImage Turn yourself into another person, change your look, add effects...
- How to Add a Sitemap.xml File to Google Webmaster Tools This lessons explains how to add your sitemap.xml file to...
























