this post was submitted on 17 Oct 2025
118 points (98.4% liked)
Open Source
41480 readers
437 users here now
All about open source! Feel free to ask questions, and share news, and interesting stuff!
Useful Links
- Open Source Initiative
- Free Software Foundation
- Electronic Frontier Foundation
- Software Freedom Conservancy
- It's FOSS
- Android FOSS Apps Megathread
Rules
- Posts must be relevant to the open source ideology
- No NSFW content
- No hate speech, bigotry, etc
Related Communities
- !libre_culture@lemmy.ml
- !libre_software@lemmy.ml
- !libre_hardware@lemmy.ml
- !linux@lemmy.ml
- !technology@lemmy.ml
Community icon from opensource.org, but we are not affiliated with them.
founded 6 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
I mostly agree with you, but this is not quite true:
Yes, the DE-specific implementations is pointless (as far as I know, I use a WM), but the XDG implementation is actually used first, and the function returns true if any impl returns true, like
xdg() || gnome() || gnome_old() || kde()
.This isn't that bad? Yes, having an enum with three variants would be better and more readable, but the code just defaults to light mode if nothing wants dark mode, and prefers dark mode even if separate impls want both light and dark mode.
With multiple impls, you have to resolve conflicts somehow. You could, for example, match on current DE/WM name, only using the current DE's impl, defaulting to XDG, avoiding the problem entirely or just use first impl that doesn't return "default" or "error".
I don't like AI generated code, having reviewed some disgusting slop before. But it's better to criticize the code's actual faults, like the incorrect impls (which you listed) or failing the Linux CI.
True, I must've read the code wrong when making the comment.
Yes, which is why I take issue with a PR (or rather what should have been a PR) that introduces crap code with clearly visible low effort improvements - the submitter should've already done that so the project doesn't unnecessarily gain technical debt by accepting the change.
Yep, that's why I think it's important for the implementations to actually differentiate between light and fail state - that's the smallest change and allows you to keep the whole detection logic in the individual implementations. Combine that with XDG being the default/first one and you get something reasonable (in a world where the separate implementations are necessary). You do mention this, but I feel like the whole two paragraphs are just expanding on this idea.
I made a mistake with the order in which the implementations are called, but I consider the rest of the comment to still stand and the criticisms to be valid.