Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linux improvements #7

Closed
1 of 3 tasks
sindresorhus opened this issue Oct 7, 2015 · 11 comments
Closed
1 of 3 tasks

Linux improvements #7

sindresorhus opened this issue Oct 7, 2015 · 11 comments

Comments

@sindresorhus
Copy link
Owner

sindresorhus commented Oct 7, 2015

@Rafi993
Copy link
Contributor

Rafi993 commented Jul 5, 2016

I have added support for cinnamon and created a pull request

@fkloes
Copy link

fkloes commented Jul 18, 2016

I think this addition might have broken the wallpaper changes for the normal gnome desktop. Since both share gsettings as command, it replaces the old entry within the availableAppsDict. In the end there are two identical entries within availableApps that reference the cinnamon command.

I figured this out while i investigated why your module doesn't work on my Ubuntu MATE image for the Raspberry Pi. In that case gsettings, gconftool-2, and dconf are available, but only dconf seems to be able to change the background. gsettings is the first found command with a setter within the availableApps, but doesn't do anything - not even when it uses org.gnome.desktop.background as key.

But i'm a little bit out of practice with Linux, so i'm not sure, if i did something wrong.

@Rafi993
Copy link
Contributor

Rafi993 commented Jul 19, 2016

@kernelkiller it might be better to try both gsettings and gconftool-2 in a sequence if one changes the wallpaper we might stop without executing the next

@fkloes
Copy link

fkloes commented Jul 19, 2016

@Rafi993 I think one problem in my distribution is, that i have settings within the org.gnome and org.mate namespace. So i get the same file on GET that i've set, but the wallpaper didn't change.

I've tested the three commands again that are available within my system, and only those two show an effect:

dconf write /org/mate/desktop/background/picture-filename "'/home/myuser/myimage.jpg'"
gsettings set org.mate.background picture-filename "/home/myuser/myimage.jpg"

The first one works perfect, the second one only works for one session, but falls back to the initial wallpaper after a restart. In conclusion the dconf rule has to be on top of the appsList for my distribution, the get changing wallpapers.

But as i already mentioned, the system to determine the right command for the current environment doesn't work so well. Adding your cinnemon rule to the appsList has overridden the gsettings rule for distributions that keep their wallpaper file within org.gnome.desktop.background. Currently it's not possible to provide different settings paths for one command. Today i spend some time to find a proper solution to fix this, but i didn't succeed.

My approach was to execute gsettings list-keys and dconf list to determine if the configuration system of the distribution provides config stores within the different namespaces:

gsettings list-keys org.mate.background
gsettings list-keys org.cinnamon.desktop.background
gsettings list-keys org.gnome.desktop.background

dconf list /org/mate/desktop/background/
dconf list /org/cinnamon/desktop/background/
dconf list /org/gnome/desktop/background/

The idea was to override the default rule for a config tool at the first successful lookup. But i've had issues to combine my code with the existing promises. Maybe a simple childProcess.execSync would solve the problem, but currently i ran out of time to take further investigations.

@sindresorhus
Copy link
Owner Author

Stumbled upon https://github.com/reujab/wallpaper/blob/master/linux.go Maybe there's something there we could borrow.

@SevenOutman
Copy link

@Rafi993 I'm using wallpaper on my Ubuntu 16.04, which uses gnome. I run the script and errors were thrown telling me I don't have org.cinnamon.desktop.background. I noticed you mentioned adding cinnamon support, so I read through the source code and found it's exactly what caused the error. gsettings with org.cinnamon.desktop.background overrides the one with org.gnome.desktop.background in availableApps.

@fa7ad
Copy link
Contributor

fa7ad commented Jun 2, 2017

@SevenOutman see my PR #17, it fixes that issue.

Psst

if you need a quick fix, try using my fork for now... until the PR is merged 😄

@deather
Copy link

deather commented Sep 14, 2017

Hi,

I encounter another problems. Like you said previously there is so many software to manage the background.

For example in my case, I use i3 as window manager, nitrogen to manage my background and gsettings to manage GTk+. In this version of wallpaper when gsettings is detected the other manager or omitted. I think it is an error not just for my case.
I think wallpaper was though to change the wallpaper, implied all manager available on the system. So the strategy shouldn't be modify the configuration of all background manager ?

@leoherzog
Copy link

Is anyone else having trouble getting this to work with Ubuntu 18.04? I'm on regular ol' Gnome Shell + Wayland and wallpaper.set() isn't doing anything...

@oboecat
Copy link

oboecat commented Jun 29, 2018

@xd1936 Can you try my changes at #36 and see if that fixes it? I have the same setup and it seemed to me like the detection command had a small typo.

@sindresorhus
Copy link
Owner Author

Closing because of #42

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants