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

4
  • 1
    have you got an encrypted /home folder?
    – fossfreedom
    May 2, 2012 at 15:35
  • No I don't have any permission restrictions nor an encryped folder
    – Kruptein
    May 2, 2012 at 15:41
  • ok - you mentioned IRC... please add your comment to your question as well as what you have discussed on IRC and have tried (but failed). Thanks!
    – fossfreedom
    May 2, 2012 at 15:43
  • That's easy I didn't try anything as nobody knew what could possibly be wrong, (I didn't get that much attention and I'm not a fan of spamming) I did however notice that my images all had chmod 700 I changed that to 775 but that didn't solve it
    – Kruptein
    May 2, 2012 at 15:48

8 Answers 8

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

.

6
  • "After the dialog is open you can click the + to add the backgrounds you just copied to /usr/share/backgrounds" This is what I am having the issue with. I hit the +, navigate to user/share/backgrounds, select the custom image and hit "Open" in Nautilus. The image does not appear for selection in the Desktop Appearance dialog Apr 19, 2012 at 22:08
  • The answer is the same, if its not working then that is bugged and should be reported as such. Apr 19, 2012 at 22:15
  • Sounds good, I will report it as a bug and see if it resolves it self when I do the Distro upgrade next Thursday. Thanks Bruno Apr 19, 2012 at 22:21
  • @StephenMyall did you report a bug? If so, could you post a link to it? I'm having the same issue (using 12.04) - the bug doesn't seem to be resolved yet.
    – Koen
    Oct 8, 2012 at 18:38
  • You do not need to have "other" permissions set to "Read and Write" for this to work. Read Only is enough. Setting to Read and Write means that anyone else with access to the system, can easily replace the image file with another. This can result in rather bad and embarrassing conditions, particularly in office settings.
    – dobey
    Jan 30, 2013 at 20:36
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.

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

1
  • Your answer more or less helped me in finding the problem. it had indeed to do with the permissions thanks :)
    – Kruptein
    May 2, 2012 at 15:53
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.)

1
  • 2
    This script is short enough that it would be reasonable to include in your answer. Of course, if you do, then people may use the script under the terms of CC-BY-SA 3.0. (They may also use it under any other terms you choose to allow, of course. Which is good, since CC-BY-SA 3.0 is not ideal as a software license.) Aug 5, 2012 at 18:15
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 tried the second variant, but it does not seem to work in 13.10.
    – user138784
    Feb 26, 2014 at 18:52
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:

1
  • only problem with this is that hte ZOOM, CENTER, SCALE etc options are not avilable Feb 23, 2016 at 1:23
0

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

sudo setfacl -R u:lightdm:rwx $HOME

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .