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

kde(fix): make wallpaper optional and nondestructive #823

Merged
merged 2 commits into from
Feb 8, 2025

Conversation

rkuklik
Copy link
Contributor

@rkuklik rkuklik commented Jan 31, 2025

Hello.

I went ahead and fixed #809. While at it, I also made the wallpaper image optional, correcting for some incorrect settings in Look and Feel, which will clash with #717 (but should be more correct).

Copy link
Contributor

@Flameopathic Flameopathic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

functionally super nice, way better than my solution.

@Flameopathic
Copy link
Contributor

consider changing the commit message.

The scope is meant to indicate which area of the code was changed. Specifying the type of change, such as feat or fix, is not necessary. Dependency updates should use whichever scope they are related to.

https://stylix.danth.me/commit_convention.html

@rkuklik
Copy link
Contributor Author

rkuklik commented Jan 31, 2025

Thank you for the review. I forgot that I shouldn't add the change type. Fortunately, the commits usually get squashed with new message on merge.

@Flameopathic
Copy link
Contributor

Thank you for the review. I forgot that I shouldn't add the change type. Fortunately, the commits usually get squashed with new message on merge.

ah, gotchya, nvm then

@trueNAHO
Copy link
Collaborator

trueNAHO commented Feb 6, 2025

IIUC, this PR does the following:

  • Reorder entries using the new local mergeWithImage function
  • Reuse Id and Name variables to avoid hard-coding them

I am slightly confused how this closes #809 and makes the wallpaper image optional. Maybe I missed something obvious...

@Flameopathic
Copy link
Contributor

Flameopathic commented Feb 6, 2025

I don't wanna take the fun or credit from the author, but I really wanna get this merged so here's how I understand it

I am slightly confused how this closes #809 and makes the wallpaper image optional. Maybe I missed something obvious...

the mergeWithImage function merges two attribute sets, strings, or lists based on config.stylix.image. If the image is null, the second attribute set, string, or list isn't merged at all, and all configuration requiring the image is in these second attribute sets, strings, or lists. that makes the image optional.
#809 doesn't seem to be fixed though.

@rkuklik
Copy link
Contributor Author

rkuklik commented Feb 6, 2025

Thank you for the lovely explanation, it is more fun for me that my code is understandable by other people. The issue unfortunatelly isn't fixed (originaly it seemed that it was only caused by plasma-apply-wallpaperimage, which is not the case). It may help people who rely on Plasma look and feel and have their autostart scripts ran in a graphical session.

Apart from that, it makes the wallpaper optional. I don't think I can do anything more now, in the issue we agreed that it would be best to ask KDE devs for help, so that we can stop requiring autostart and only use normal activation. I can ask them when I have more time.

I don't think the original issue is within our power to solve, but it does make the wallpaper optional and plasma-apply-wallpaperimage not a requirement for activation, so I would also like this to be merged.

Copy link
Collaborator

@trueNAHO trueNAHO left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am slightly confused how this closes #809 and makes the wallpaper image optional. Maybe I missed something obvious...

the mergeWithImage function merges two attribute sets, strings, or lists based on config.stylix.image. If the image is null, the second attribute set, string, or list isn't merged at all, and all configuration requiring the image is in these second attribute sets, strings, or lists. that makes the image optional.

[...]

Thank you for the lovely explanation, it is more fun for me that my code is understandable by other people.

Thanks for the great explanation. Now everything makes senese.

Somehow I missed the

if image == null then
default

branch everytime I re-read the code...

@trueNAHO trueNAHO merged commit ff8ce4f into danth:master Feb 8, 2025
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow plasma-apply-wallpaperimage to fail
3 participants