Bug 511377 - plasma-apply-wallpaperimage does not respect the 'Switch dynamic wallpapers' setting
Summary: plasma-apply-wallpaperimage does not respect the 'Switch dynamic wallpapers' ...
Status: CONFIRMED
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (other bugs)
Version First Reported In: 6.5.1
Platform: Manjaro Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-30 14:22 UTC by Joerg Fischer
Modified: 2025-10-31 20:31 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joerg Fischer 2025-10-30 14:22:56 UTC
SUMMARY


STEPS TO REPRODUCE
1. Select the standard Next (Orionids) wallpaper and select 'Always use light variant'
2. Go to the Plasma Style settings and select 'Breeze Dark'
3. Run `plasma-apply-wallpaperimage /usr/share/wallpapers/Next`

OBSERVED RESULT

The wallpaper's dark variant image is shown.

EXPECTED RESULT

Since we have 'Always use light variant' the light variant should *always* be shown.

SOFTWARE/OS VERSIONS

Operating System: Manjaro Linux 
KDE Plasma Version: 6.5.1
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.12.56-1-MANJARO (64-bit)
Graphics Platform: Wayland


ADDITIONAL INFORMATION

Notice, if you switch between Breeze Light and Dark now you see that the wallpaper's variant follows the Plasma style directly. That is given the state after steps 1., 2., 3. do

4. In the settings change to Breeze Light from Breeze Dark

Result: light variant is shown

5. Change to Breeze Dark again

Result: dark variant is shown

This latter steps 4. and 5.  are *without* running `plasma-apply-wallpaperimage /usr/share/wallpapers/Next`.
Comment 1 Nate Graham 2025-10-30 16:44:00 UTC
Can confirm.
Comment 2 Harald Sitter 2025-10-31 12:25:14 UTC
Hm. So. The CLI tool is a different way to set wallpapers, not a different interface for the same config. Notably you'll also observe that the fill mode is entirely controlled by the CLI and also not honored from the KCM. Given this pre-existing behavior I find it hard to justify honoring the KCM for the light vs dark scenario. That said, there is no way to control light vs dark from the CLI right now... which is indeed a problem.
Comment 3 Joerg Fischer 2025-10-31 15:36:14 UTC
> The CLI tool is a different way to set wallpapers

Just a reminder there is also the 'wallpaperPlugin' as part of the Plasma scripting API cf. https://develop.kde.org/docs/plasma/scripting/api/#desktops and this also doesn't follow the setting, although i'm not sure if i understand what you mean. I think it shouldn't matter - there are Plasma configurations and these aren't merely entries in some particular drop-down field. I mean there are also UI-less configuration systems, that is, the once where the user has to edit large text files manually to change the settings which is less convenient but the same thing. In the end the configurations are stored in text files and in the Plasma scripting API you can access these for instance the color scheme like so
~~~
    const config = ConfigFile('kdeglobals');
    config.group = 'General';
    config.readEntry('ColorScheme');
~~~
so i wouldn't know why the configurations shouldn't be available - even less so from the C++ level.
Comment 4 Harald Sitter 2025-10-31 15:44:24 UTC
> In the end the configurations are stored in text files and in the Plasma scripting API you can access these for instance the color scheme like so

Yeah, from a glance that doesn't seem true. Light vs dark is a flag on the URI of the image. It's not an explicit setting, which is why it gets overwritten when applying the wallpaper using the CLI.
Comment 5 Joerg Fischer 2025-10-31 15:58:09 UTC
Yes there must be some logic to determine the full image path (if not given explicitly) and this logic has to be adapted to follow the new configuration settings for the wallpaper. This was overlooked, nothing more.
Comment 6 Vlad Zahorodnii 2025-10-31 19:51:27 UTC
(In reply to Joerg Fischer from comment #5)
> Yes there must be some logic to determine the full image path (if not given
> explicitly) and this logic has to be adapted to follow the new configuration
> settings for the wallpaper. This was overlooked, nothing more.

Well, yeah, I wasn't even aware that there is such a tool. So we have one config but two different paths to change. Whether light or dark or dynamic wallpapers are used depends on the fragment in the URI, but there is also an option to keep user's overall preference. The URI contains wallpaper variant info because it simplifies wallpaper plugin bits quite a bit.

Circling back to `plasma-apply-wallpaperimage`, I guess it could look at that option and append #day-night and so on. In long term, I think it would be nice to unify how various settings are changed, maybe provide some system configuration C++ APIs in libkworkspace. I encountered a similar problem while looking into global themes, various bits are scattered all over the place (and there is also code duplication).
Comment 7 Vlad Zahorodnii 2025-10-31 19:51:56 UTC
two different paths to change it*
Comment 8 Joerg Fischer 2025-10-31 20:31:14 UTC
In 6.4 the command `plasma-apply-wallpaperimage /usr/share/wallpapers/Next` picked either the light or the dark variant just like it does now. The only difference is that in 6.4 this choice was done according to whether the color scheme was interpreted as light or dark. In 6.5 it does the same thing only instead of deciding by color scheme it decides by plasma style. The problem with this is that in 6.5 there are configuration options for the wallpaper not present in 6.4. Following the plasma style is only one of these new settings.