Wallpaper set by variety is not used for login screen

Bug #1066113 reported by Felix Haller
44
This bug affects 7 people
Affects Status Importance Assigned to Milestone
Variety
Fix Released
Undecided
Peter Levi

Bug Description

Since Ubuntu 12.04 the last selected wallpaper is used as background for lightdm login screen. When Variety is setting wallpaper this one is not used for the login screen.

Revision history for this message
Peter Levi (peterlevi) wrote :
Revision history for this message
Peter Levi (peterlevi) wrote :

I played some more with this.
There are some conditions for lightdm to use the background picture:

1. "Other" users need to have access to the file. In my case, Variety uses the default download location ~/.config/variety/Downloaded, By default only I have access to those files (they are in my home). So I tried granting other users access to my home folder, to ~/.config, and to ~/.config/variety - i.e. all the folders in the path and now lightdm uses the images set by Variety.

2. It seems it needs to be on the main drive, not on a mounted partition
My Favorites are on a mounted external partition and lightdm does not use those pictures. Probably the mount uid, gid and masks options play a role here - maybe this boils down to the same as 1 - that the other users don't have the proper permissions over these files.

Probably a good setup would be to have some global folder (on the main partition, e.g. /pics), readable and writable by everyone, and then configure Variety to download inside it, and also to keep Favorites there. This works OK for lightdm. However Variety cannot enforce this setup at installation, as it can only write inside the user's home folder.

Revision history for this message
Peter Levi (peterlevi) wrote :

To recapitulate: Lightdm IS using the wallpaper set by Variety, if it is accessible by the lightdm user (e.g. pictures in /usr/share/backgrounds), however the default Downloaded/Favorites locations are not accessible by the ligtdm user as they are (and must be) inside the user's home.

Changed in variety:
status: New → Invalid
Revision history for this message
Felix Haller (felixhaller) wrote :

I played a little bit with this problem and found out that this bug only occurs when variety is running before you log off.

to reproduce (assuming that you have set the right permissions (look above)):

(variety is set to autostart)

* change wallpaper (i think this step is not necessary)
* log off
* on the lightdm login screen you will see the standard ubuntu wallpaper
* login again
* change wallpaper (also not necessary)
* close variety with the help of the indicator
* log off
* you will see the wallpaper you set before

Anyone can confirm this? Any idea what the problem is?

Revision history for this message
Peter Levi (peterlevi) wrote :

Could you please add this line to the file ~/.config/variety/scripts/set_wallpaper (in the section for Gnome3/Unity) and tell me if it improves things for you?

gsettings set com.canonical.unity-greeter background "$1"

Thank you.

Otherwise it really should not matter whether Variety is running or not for this. All it does to set the wallpaper is to set the gsettings property for the wallpaper, afterwards it is gnome-settings-daemon's responsibility to actually update your screen, lightdm, etc. While Variety is idle and not changing the wallpaper (or downloading files) it does not do anything at all - its threads are simply sleeping...

Revision history for this message
Felix Haller (felixhaller) wrote :

HA!!...i found out what the problem is....THE CLOCK!

When I've activated the desktop clock in variety the wallpaper is not shown in Lightdm after logging off. When it's deactivated all is working like expected also when variety is running during logoff process.

I think the clock is responsible for variety not being "idle".

Should I open a new bug for this or will you handle it in this one?

PS: The line in the config file (your last post) makes no difference for me.

Revision history for this message
Peter Levi (peterlevi) wrote :

The clock is drawn on the wallpaper image and the resulting image ends up in ~/.config/variety and is set as desktop wallpaper. Again, if your permissions are ok, it will be used as a greeter (but the clock won't be updated while you are in the login screen, so I am not sure you want this - you'll be looking at an outdated clock on the greeter). The same thing happens with the other effects as well - they are applied on the original image, the result is saved in ~/.config/variety, and it is set as wallpaper.

It is true that the clock thread runs once every minute to update the wallpaper, but again I don't think this has anything to do with lightdm.

I will research whether it is possible to have the greeter and the wallpaper set to two different custom images at the same time (using the command above - gsettings set com.canonical.unity-greeter background "$1"). You can also help me with this part.

If this is possible, I can make the necessary changes so that it is possible to set the greeter to the wallpaper image before drawing the clock (but after other effects like blurring are applied).

If not, fixing this would require using some completely different way of drawing the clock on the desktop (ala conky), which I won't commit to doing for now, as the problem will be too small compared to the invasiveness of the solution.

Changed in variety:
status: Invalid → Triaged
Revision history for this message
Felix Haller (felixhaller) wrote :

Thank you for the fast response. After you mentioned the effects I also tested them. And the same problem as with the clock is also there. That means if any effect is set the default Ubuntu Wallpaper is shown with Lightdm.

How can I help you?

Revision history for this message
Peter Levi (peterlevi) wrote :

"That means if any effect is set the default Ubuntu Wallpaper is shown with Lightdm." - unless you adjust the permissions. As pointed earlier, Variety cannot escape from this - it needs to write to ~/.config/variety, where other users have no permissions to read.

"How can I help you?" - please test if using the gsettings commands it is possible to have, at the same time, two different custom pictures for the greeter and the wallpaper.
gsettings set org.gnome.desktop.background picture-uri "file://path/img1"
gsettings set com.canonical.unity-greeter background "/path/img2"

At the moment I simply can't afford to test this, as it takes lots of time logging off/on.

Revision history for this message
Felix Haller (felixhaller) wrote :

I added these lines but:

- the background changed to Ubuntu default wallpaper
- the Unity greater shows the last selected picture (the one i had before I added the gsettings lines), but not the one I selected for the greeter

Peter Levi (peterlevi)
Changed in variety:
status: Triaged → Won't Fix
Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Well,

Now I am at home and was analyzing my file system, in particular the one where my Wallpapers are located.
And now I remember why I always mount my Data partition in /mnt
When You mount a partition there, in /mnt/, then everyone should be capable of read and write in that partition. Root, users, other, groups, everyone can read and write there.

So, when you say that Unity is the guilty, the reason why Variety cannot set the wallpapers in the Light DM background, maybe you are wrong, Peter.

I will be waiting for your answer.

Bye.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

I use to mount my Data Partition in /mnt/ because I used to have issues when creating a new user as Standard User. Then this new user were not able to read or write in this data partition. So I started to mount it in /mnt/ instead of the default mount location, that is /media.

Maybe you are right when you say that Unity/Ubuntu Raring is the guilty, but not for the reason you say, maybe. I am not sure, I need a better explanation.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Something that is not clear for me until now. Why Variety sets my wallpapers in LightDM in Ubuntu 12.04 and It is not capable to do the same in Ubuntu 13.04, if those wallpapers are in the same location? :D Hahahaha! That is why I do not believe in those reasons wrote up there.

Same Variety version in 12.04 and 13.04, same wallpapers path, different behavior. Why?

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Ah, another thing, maybe important here:

Being in 12.04, when I set /Effects/Filter/Keep Original (ImageMagick plugin) in the Variety Preferences &/or I set "Show Random Quotes On The Desktop" feature, then the Wallpaper set by Variety wont set in LightDM.
And, yes, we are talking about Ubuntu 12.04, where Variety actually do set wallpapers in LightDM with a default configuration.

BTW, I never use Wallpaper from Internet in Variety, only local Wallpaper paths.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

In entry #4 Felix is talking about login off and turing of Variety before log out.
If you add that to my entries about my /mnt/ path location, then, with that in mind, maybe Variety is the problem, not Ubuntu.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

To Feliz Haller:
No man, It si not the CLock, I never use the Clock.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

I am going to copy the Variety home configuration files from my Ubuntu 12.04 home and paste it (replace) in the Ubuntu 13.04 Variety configuration files.
Then I will tell you if something good happens.

BTW, the Bug Description for this thread is funny :D Missing a lot of details to help focus the problem.

Revision history for this message
Peter Levi (peterlevi) wrote :

The only thing Variety does is call a gsettings command to instruct Gnome "look, this should be the new wallpaper". From there on Variety does nothing, Ubuntu/Gnome/Unity is responsible for redrawing the wallpaper and dealing with LightDM. LightDM has its own requirements about the image, one of them is that obviously it should be readable by everyone, there are others too and I don't know them all. For example an image in your Pictures folder would work, but not inside a subfolder in Pictures.
I'm pretty sure images on mounted partitions never worked, not even on 12.04, probably because the mount point will not necessarily be there on next reboot.

In any case, Variety does NOT deal directly with LightDM, it never has, not in 12.04, not in 13.04, Gnome does.

Why it is different between 12.04 and 13.04 I don't know, it may some difference in your setup, it may be due to updates to LightDM or something else in Unity/Gnome.

Now, if you set a specific wallpaper directly from Appearance and it appears in LightDM and then you set it from Variety and it does NOT appear in LightDM, this would prove Variety is not doing something right in this regard, and I'll be open to suggestions - everyone can edit the ~/.config/variety/scripts/set_wallpaper script and try what command would actually fix things with LightDM. But this hasn't happened on my machine.

For clock, filters and quotes Variety needs to build a new image, it has no other place to save it but the ~/.config/variety folder, LightDM cannot use it from there, so basically this is a known and unavoidable problem.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Ok, I changed the wrong path for this new user.
Peter, maybe you should not use absolute paths qhen you are working with home paths. It makes imposible to set backups with tools such as DejaDup.

Now Variety is running.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

And NO, replacing the home Variety config files ~/config/variety/ from 12.04 to 13.04 does not help at all. The bug remains.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

And Peter, why you keep talking about Gnome, if it is happening also in Unity? You say Variety acts in Unity as it was playing in Gnome?

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Well, in 13.04, if I change wallpaper with the default Unity tool to set a new wallpaper, It changes in LightDM. Then, if I try to do the same with Variety, It does not change the wallpaper in LightDM.

Revision history for this message
Peter Levi (peterlevi) wrote :

I talk about Gnome, not Gnome Shell. Unity runs on top of Gnome, it is not a separate desktop environment.

Where is the image located?

Revision history for this message
Peter Levi (peterlevi) wrote :

Actually after some thinking about the problem, this bug might be fixable, at the price of a file copy operation on every wallpaper change.

In ~/.config/variety/scripts/set_wallpaper instead of calling:

gsettings set org.gnome.desktop.background picture-uri "file://$1" 2> /dev/null

we can call:

cp "$1" ~/Pictures/variety-wallpaper.jpg
gsettings set org.gnome.desktop.background picture-uri "file://home/username/Pictures/variety-wallpaper.jpg" 2> /dev/null

This should be good for LightDM (as long as I remember it works with images in ~/Pictures).

I'll let you give it a try and report back on your success with this before I start thinking whether to make it the default behaviour ;-)

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Hi Peter,
let me try what you suggest....

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Sorry, I do not understand exaclty what you want me to do.

I have this:

##########################
# Gnome 3, Unity
gsettings set org.gnome.desktop.background picture-uri "file://$1" 2> /dev/null
if [ "`gsettings get org.gnome.desktop.background picture-options`" == "'none'" ]; then
    gsettings set org.gnome.desktop.background picture-options 'zoom'
fi
#############################

Which part you want me to replace with?

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

In my last post, when I replace all that with the code you suggest, then the wallpaper does not change in the desktop, It sets the default Unity Wallpaper as the desktop background.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

It does not work at all.

Revision history for this message
Peter Levi (peterlevi) wrote :

Try with this file. Put it ~/.config/variety/scripts. Replace or rename the existing one.

Peter Levi (peterlevi)
Changed in variety:
status: Won't Fix → In Progress
assignee: nobody → Peter Levi (peterlevi)
Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

That script does not help.
Do you want me to send you an output running Variety with that script from the terminal?

Revision history for this message
Peter Levi (peterlevi) wrote :

This script worked perfectly here, I tested it in a fresh install of 13.04.

Ignore Variety for now. This script should work standalone. Try two things:

1. Confirm that when you set a wallpaper which resides in your ~/Pictures folder manually from Ubuntu's settings you see it in LightDM after logout. This works on a fresh install of Ubuntu 13.04. If this does not work for you, perhaps your permissions are wrongly set (at least differently from the defaults).

If 1) passed OK:
2. Try running the script manually, passing the full path to some different image as a parameter. Was the image copied OK to your ~/Pictures folder under the name variety-wallpaper.jpg? Does it set it as wallpaper? Do you have it in LightDM?

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Ok,

Now I can see this is ALL ABOUT PERMISSIONS.
Ubuntu changed the way it sets permissions for the file system.
In Ubuntu 12.04 all my files in /mnt/Almacen/ have permissions to Read and Write for "Others".
Now, In Ubuntu 13.04 all my files in /mnt/Almacen/ have permissions to "Others" as NONE. I mean, Others do not have any permissions to handle those file in that path.

With the new "set_wallpaper" script you gave me, Peter, this Script sets the image inside ~/Pictures but also with NONE permissions for "Others", so It is the same thing as they would be in my /mnt/Almacen/ path. Then, that script and the old scrpit does almost the same about permissions.
What I need is give in my /mnt/Almacen/ path permissions to Read and Write to "Others", to all the files inside that path, and then Variety would be capable to work fine with LightDM in Ubuntu 13.04.

Note: I do not have any idea why It works for you in your just installed Ubuntu 13.04.

Waiting for comments and suggestions/recommendations.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

When I change the permissions for the images inside ~/Pictures (Read and Write for "Others") then LightDM can work with those pictures.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

What I do not understand is why if those pitures inside ~/Pictures and inside /mnt/Almacen/ have Read and Write permissions to Root, then LightDM cannot use them as its background.

Which command could I use to set all those images inside /mnt/Alamcen/ as Read and Write for "Others"?

Revision history for this message
Peter Levi (peterlevi) wrote :

Try adding this line in the script:

chmod a+r $HOME/Pictures/variety-wallpaper.jpg

immediately after the line
cp "$1" $HOME/Pictures/variety-wallpaper.jpg

This should fix the permissions of the file before it is set as wallpaper.

Permissions on mounted locations depend on how you mount them, parameters in fstab, type of the filesystem, etc. You'll need to read some guide on this, there are a lot of details and I'm not an expert in this. Also think carefully before giving read access to your files to everyone on the system.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Thank you very much, Peter!
That works for me!
I am attaching the "Set_Wallpaper" file that works, here.

Note: I commented out all the lines but the one for Unity/Gnome 3, because that is the one I need

Revision history for this message
Peter Levi (peterlevi) wrote :

Note to myself:

While this works, we cannot have it by default as it presents a security/privacy concern - it exposes user's potentially private files to the other users on the system.

The solution is to have an option for this, with a warning about the security concerns, not enabled by default, and to do these actions in the python code conditionally, not in set_wallpaper.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Thank you, Peter.

If you want me to test some scripts to introduce this feature/improve to your Variety Wallpaper Changer, do not hesitate to contact me.

Best regards,

Revision history for this message
Peter Levi (peterlevi) wrote :

Mauricio, please help me test the bugfix.
Rename or remove your current ~/.config/variety/scripts folder, then install the attached version, run it, tick the LightDM option in Customize tab and see if LightDM correctly picks up Variety's wallpaper. Thanks.

Changed in variety:
status: In Progress → Fix Committed
Revision history for this message
Peter Levi (peterlevi) wrote :

"Peter, maybe you should not use absolute paths qhen you are working with home paths. It makes imposible to set backups with tools such as DejaDup."

This is addressed in https://bugs.launchpad.net/variety/+bug/1181736

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Hi Peter!

Sorry, I was very busy these days.

Let me try the fix you implemented, and I will let you know in a few minutes....

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Already installed! Now I am going to log out, and then reboot to try the whole process...be back in a minute...

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Peter,
Until now everything seems to work pretty fine.
Logout/pogin process works fine with the new LightDM option.

So, It will be in testing a few days here and I will let you know if nothing wrong happens.

Revision history for this message
Peter Levi (peterlevi) wrote :

I hope you recalled to rename or remove your previous ~/.config/variety/scripts folder? Otherwise it might be working just because of the previous fixes?

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

Oh no! I forgot that part!!!....

Are you kidding me? Of course I did that. That is the least I can do for your work... following your advice and recommendations.

It is working with the new script.

I ticked the LightDM option in Preferences/Customize.

Peter Levi (peterlevi)
Changed in variety:
status: Fix Committed → Fix Released
milestone: none → 0.4.15
Revision history for this message
Jonathan D'Orleans (jonathan.dorleans) wrote :

Hello guys,

When is this fixing going to be available for update?

thx,

Revision history for this message
Peter Levi (peterlevi) wrote :

It was released with 0.4.15, uploaded long ago in the PPA. Whether and when it will make to the official extras repository is not clear, as I don't control the things there. In any case I highly recommend using the PPA for Variety, not the package in extras.

Revision history for this message
Matteo Pagliazzi (paglia) wrote :

H, I noticed that also when using only local files in a subdirectory of /Pictures in my Home directory the files are still copied i /Pictures by Variety when enabling LightDM support, the images shouldn't be copied if using a directory accessible to lightdm and I thhink that a subdirectory of /Picture is accessible to it at the same way the /Picture folder is. Right?

Revision history for this message
Peter Levi (peterlevi) wrote :

No, I think LightDM cannot use pictures in subdirectories of Pictures. In any case the policy to always copy the image, regardless of where it is, is much simpler and less error-prone than to special-case certain directories so this won't change.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

@Matteo:
In Linux, regardless where a file is located, it has some permissions due to the EXT file system type; if that file has not the right permissions to be read by LightDM, then It will not be read before login. So Variety have to recreate the image you want to use and give it the right permissions to be used by LightDM. No matter you write it inside a folder inside ~/Pictures, this image has an owner and a set of permissions.

Bye.

Revision history for this message
Mauricio Mora Meza (mauricio.mora) wrote :

@Mateo:
If you want to avoid that behavior, all you have to do is not use LightDM Variety feature, and, instead, set the right permissions to all the pictures you want Variety set in LightDM login screen, something like as follow:
# sudo chmod 777 /[your_pictures_path]/*.*

Note: And everytime you copy a new picture/wallpaper inside that path you will need to give that picture the right permissions/maybe full permissions like chmod 777.
chmod 777 gives full permissions to a file, a folder or a list of files. I think you should learn about giving file/folder read/write/execute permissions.

Bye.

Revision history for this message
Jazz (iguanamiyagi) wrote :

I have a clean installation of Mint 15 MATE with a brand new Variety 0.4.17 on it. I have also replaced MDM with LightDM.

My primary (superuser) account has an encrypted home folder and I created 2 new Desktop users with their home folders without the encryption. Each of my users have configured their Variety preferences with their own settings, including me - with my superuser account.

I have enabled "Login Screen Support" in Preferences > Customize and selected /usr/share/backgrounds as a path for that feature. I have disabled a clock, image effects and quotes on my wallpapers. Then I chmod 777 that particular folder, and chmod 666 each *.jpg file in it. I restarted the system numerous of times after all that.

The result: I cant see any custom wallpaper on my login screen (greeter). Any clues?

Revision history for this message
Jazz (iguanamiyagi) wrote :

I even tried to replace:
gsettings set com.canonical.unity-greeter background "$WP"

... with:
gsettings set com.canonical.unity-greeter background "/usr/share/backgrounds/existing_image_with_proper_chmod.jpg"

... for each of my existing user (inside of their "set_wallpaper" config files), but with no luck!

Revision history for this message
Peter Levi (peterlevi) wrote :

Ignore Variety for now, can you make LightDM display your wallpaper when you set it in the ordinary way?
If not, you'll have to address this first before trying Variety again.

Revision history for this message
Jazz (iguanamiyagi) wrote :

I succeeded to set the background image at the login screen by following the following tutorial:
http://www.noobslab.com/2013/09/install-lightdm-display-manager-in.html

Now, since I use this tweak tool, I have my background fixed on that page, but that's fine. I accidentally have an added value now - I can see the background that I want at the login screen and I'll still be able to use effects, the clock at the desktop wallpaper separately. Even I'm not quite sure what happened here, the present situation fits my needs.

Revision history for this message
rubo77 (rubo77) wrote :

On Ubuntu 18.04 this seems not to work anymore.

Revision history for this message
rubo77 (rubo77) wrote :

As a workaround, I created a cronjob, that copies the current background to a safe location and add that location to the ubuntu.css with

    cp "$(gsettings get org.gnome.desktop.background picture-uri|sed "s~'file://\(.*\)'~\1~")" /usr/share/backgrounds/current-background.png

see https://askubuntu.com/a/1145846/34298

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.