lximage-qt
lximage-qt copied to clipboard
Set as wallpaper
It will be nice to have an option to set the current image as wallpaper.
@PCMan Assigning you since this is pcmanfm functionality. Or libfm maybe? Is there a spec somewhere on wallpapers?
Maybe, an editable list of commands and process conditions? With some defaults.
Which command is triggered depens on current running processes. E.g.: if spacefm process is running in current session, execute spacefm --set-wallpaper $FILE, etc
I'm against such an option because lximage-qt can be used outside LXQT and who knows how the wallpaper could be set for other desktops (consider Enlightenment as an example)?
That said, if the option in question can be added in such a way that it's enabled only when the desktop is drawn by pcmanfm-qt, it'll be worth considering, IMO.
It definitely would have to be considered that LXImage-Qt can be run without LXQt.
But isn't it rather easy to check whether or not it's running in an LXQt session? Couldn't this e. g. be done by evaluating $XDG_CURRENT_DESKTOP or looking for a PCManFM-Qt instance that's running with switch --desktop set?
Being able to set wallpapers from an application that at the same time allows for browsing available graphics seems to be a feature that many users want. It doesn't get and hardly can ever get provided by GUI "Desktop Preferences" (invocation pcmanfm-qt --desktop-pref=[...]), though.
So it would really be quite an advantage to complement LXImage-Qt with the ability to set wallpapers, IMO.
Unfortunately, there is no XDG spec for handling wallpapers. Ideally, there should be one. I think the best way to go is to start the push for creating a new one. The first step on that would be creating a working prototype.
One way it could work is making pcmanfm-qt register itself as a wallpaper handler. lximage-qt would look for a handler, find pcmanfm-qt and ask it to set the wallpaper. Of course, that would be though DBus, just like the status notifier works. Another way would be through a simple configuration file.
I'm sure that must have been discussed before in the linux comunnity.
Would-be spec should be simpler. Setting a desktop(s) image(s) can do away without DBus or other overengineered stuff. Something like $XDG_CONFIG_HOME/wallpapers/[files in alphanumeric order] or ini-style config file.
I have lost hope in xdg. The mailing list is completely unresponsive any time something is proposed. I believe a wallpaper spec was proposed at some point, but essentially nobody cared.
It's annoying.
It must be something robust enough to be accepted by other DEs and become a standard. I like @Vladimir-csp's idea, but I think we should foresee the possible future generalizations, like handling the login screen's wallpaper, global wallpaper (for all users), multiple-images wallpaper and probably more. We could start implementing it in pcmanfm-qt and when we feel it's ready, we promote it for adoption.
looking for a PCManFM-Qt instance that's running with switch --desktop set
That could be practical. I'll experiment with it.
That could be practical.
Maybe pratical, but inelegant and too specific.
Thinking about @Vladimir-csp's idea again, I now dislike it. Issues:
- lximage-qt (or any other app) wouldn't know if there is a wallpaper handler active.
- lximage-qt would need to mess with the config file by itself, even though it's the handler's responsability.
The most correct and elegant way to go IMO is to use DBus. It looks overcomplicated for such a small task, but it'd fix all issues. Only the handler changes the configuration, and lximage-qt would know the presence of it.
Maybe practical, but inelegant and too specific.
IMO, it should be specific (to pcmanfm-qt) for the reason I mentioned above. As for elegance, it could have a clear meaning when it's about appearances, which, of course, are important to me. I could argue that adding dbus dependency for such a job is "inelegant" or "disproportionate" -- but I don't ;)
Thinking about @Vladimir-csp's idea again, I now dislike it. Issues:
lximage-qt (or any other app) wouldn't know if there is a wallpaper handler active. lximage-qt would need to mess with the config file by itself, even though it's the handler's responsability.
If there is a spec on the config file, no app should care or know about whether there is a wallpaper handler active, it should just update the file according to the spec. Handler should care about the rest when it sees config file being modified.
If there is a spec on the config file, no app should care ...
If I've got your point correctly, that would need changes outside lximage-qt. Wouldn't it be better to first focus on lximage-qt itself? I'll do some experiments when I have time.
As an experiment, PCManFM could divert wallpaper configuration to a neutral config file and that could be made a working proposition for the spec. Even if XDG would be slow to react, others may follow.
Proposing an XDG spec for this is really a good idea. The only problem is, we might be the only one who use it. At least Gnome won't use it since they put every configuration in their dconf. However, I'd say let's do it. At least get this well-documented so other apps which want to support the functionality can do it easily.
Great! So, the basics, what parameters should be stored. If it is ini config file, it would be something like this:
[desktop_0]
filename=
scale_method= ;none|tile|stretch|fit|crop
color_1= ;background color
color_2= ;second background color for optional gradient
gradient_type= ;none|horizontal|vertical
Can be done like that, with custom actions: