20

As the title above suggests I want to add some custom wallpapers (png images I have created myself) to the user/share/backgrounds folder in 12.04. I have completed this task.

Issue : They do NOT appear in the Desktop Appearance for selection ( I am assuming if they did appear here they would be the default background in the LightDM dynamic unity greeter. Only the "contest images" work with unity greeter. I came across the links below which are similar but to not resolve my question

How do I add new wallpapers? (Refers to 11.10 only)

How do I change the wallpaper of the login screen? (SHows only how to turn off Dynamic unity greeter and assign a fixed background for LightDM

After some thought this may also be a permissions issue. The reason for suggesting is that I copied a theme folder using sudo nautilus. The theme did not appear in "Advanced Settings" for selection. To make this theme work in Unity I copied it to ~.themes. I copied the bankgrounds using the same method

stephenmyall
  • 9,885

8 Answers8

19

After you added you images to /usr/share/backgrounds you need to open the Change Desktop Background dialog by right clicking in your desktop and selecting it.

After the dialog is open you can click the + to add the backgrounds you just copied to /usr/share/backgrounds

enter image description here

Add all the images you have in /usr/share/backgrounds, after you have done that you can select one and it will become your background.

If you are using 12.04 that same image will become the dynamic background for the Unity Greeter. If it does not follow the Setting the dynamic switching off section of How do I change the wallpaper in LightDM? except instead of actually switching it off you use the command

gsettings reset com.canonical.unity-greeter draw-user-backgrounds

has described in the answer.

Note to summarise:

  • Step 1: Add you custom wallpaper to `/usr/share/backgrounds

  • Step 2: Is conditional if you want your custom wallpaper to appear in the dynamic unity greeter (log in) in 12.04. Right click on your custom image and select "Properties" then select the Permissions tab. Navigate to the "Other" permission and change it from None to "Read-only". Note: If you don't do this Unity's default wallpaper will appear in Unity Greeter.

  • Step 3: Now you need to open the Change Desktop Background dialog by right clicking on your desktop and selecting it.

  • Step 4: After the dialog is open you can click the + to add the backgrounds you just copied to`/usr/share/backgrounds.

  • Step 5: Select your image to and change your desktop background`

  • Step 6: Log out and see the Unity Greeters background is your custom image

.

Bruno Pereira
  • 74,715
3

You have to edit the files in /usr/share/gnome-background-properties in order for them to appear in the 'wallpaper' section rather than the 'picture' section.

3

I am using 12.04 Gnome Classic desktop. None of the solutions above have helped me to display my wallpapers in /user/share/backgrounds. If I click on + as suggested above, Ubuntu 12.04 opens my Pictures folder and does not add the wallpapers I added to /usr/share/backgrounds. The only way that I have found to do this is to add them to the precise-backgrounds.xml file as new items between the main <wallpaper> </wallpaper> tags. This is really a nuisance if you have a large number to add. I am hoping that someone has a simpler solution.

The only way that I have found to add my wallpaper to my login name in the greeter is to install Ubuntu Tweak and then set it using its options.

Eliah Kagan
  • 119,640
2

I had similar issues, I don't know if there is another solution but here is mine.

Copy and paste your wallpaper into usr/share/backgrounds. (Use gksu nautilus)

Right click on your image file and select properties

In the permissions tab make sure "Other" is set to Read or Read Only

Right click on your Wallpaper and set it as your desktop background

Log out and it should appear as Your LightDM paper

I dont know anything about Wallpaper Switcher however if this application can retrive the files from the usr/share/background location, Im sure it will work

amc
  • 7,292
stephenmyall
  • 9,885
2

I'd written a little perl script to make it easier to add choices to the Change Desktop Background in Ubuntu.

To recreate it you could, for example, use sudo gedit /usr/local/bin/wallpaper-add-to-choices from terminal, paste the contents of the script, save, then sudo chmod 755 /usr/local/bin/wallpaper-add-to-choices.

I found post this because I was searching for info about what might have changed in Ubuntu 12.04LTS. The "options" portion of that script output used to say "scale", I had to change it to "zoom" or none of the images would work as choices. It's a shame, I don't feel like manually resizing the dozens of images imported to a new system to scale them properly. (Scale letterboxed the images, only enlarging the image until any edge hit the edge of the display, zoom means I lose the tops or sides of most images.)

Eliah Kagan
  • 119,640
2

There is also another option that will make wallpapers from user's home directory available in lightdm.

You can choose one of two variants:

Variant A.

You just have to run one simple command in terminal:

$ sudo usermod -aG username lightdm

Just replace username with your username. This will grant lightdm access to your home directory, so it will be able to display images from /home/username.

Variant B.

Create new usergroup named, for example, wallpapers:

$ sudo groupadd wallpapers

Then, create a directory in your home directory, where you will store all wallpapers you want to use and change it's group to wallpapers:

$ mkdir '~/My Wallpapers'
$ chgrp wallpapers '~/My Wallpapers'

And finally add group wallpapers as supplementary group for you and lightdm user:

$ sudo usermod -aG wallpapers username
$ sudo usermod -aG wallpapers lightdm

Remember to replace username with your username.

Notice that if you have more than one user using the system and you want to give ability like this for every one of them, you will have to repeat these steps (omitting adding new group - wallpapers) for each individual.

1

I can confirm this works!

  1. After copying new *jpg files into the /usr/share/backgrounds/ folder (using root)
  2. Edit the 2 *xml files under /usr/share/gnome-background-properties/

I used gvim editor for 2. above.

Just do these steps using gvim:

  • gvim /usr/share/gnome-background-properties/*xml

  • Shift+G to go to end of file

  • Shift+O to insert above the last line
  • :r !ls

    /usr/share/backgrounds/*jpg → to insert all the new background. filenames

  • Now go to the beginning of inserted block text.

  • Use this command in gvim after : (Replace ^M with CTRL-M )

    :.,$s;\(.*\);^M\t<wallpaper>^M\t<name>paper10</name>^M\t<filename>&</filename> ^M\t<options>zoom</options>^M\t<pcolor>#000000</pcolor>^M\t<scolor>#000000</scol or>^M\t<shade_type>solid</shade_type>^M\t</wallpaper>^M;cg
    

Auto increment numbers (paper10) to give unique names to wallpapers

 :let i=1 | g/>paper/s//\='>paper_'.i/ | let i=i+1

Save the file and repeat for the second XML file.

Newly added backgrounds will now appear in the GUI:

Jossshe
  • 11
0

You must give permissions to lightdm to read your personal directory:

sudo setfacl -R u:lightdm:rwx $HOME