Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions core/internal/matugen/matugen.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,8 @@ func Run(opts Options) error {
syncColorScheme(opts.Mode)
}

applyKDEColorScheme(opts.Mode)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The GTK version is gated on whether or not the user is actually using the DMS colors or not, I think we need something equivalent. Like we wouldn't wanna apply the scheme if they're using something besides DankMatugen

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

But shouldn't that be the kde color sync? Otherwise what's the point in syncing kde colors ?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The matugen is running unconditionally on theme changes I mean. If someone has Breeze configured won't it change it to DankMatugen even if they didn't want that? Some users want dms without all the themes it provides

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Well the color scheme works fine with Breeze that's specifically what Kcolorscheme is designed for. But maybe I should check if QT_QPA_PLATFORMTHEME is set to kde with QT_STYLE_OVERRIDE Breeze. I imagine it might cause problems with kvantum. But the people that use kvantum seem to set QT_QPA_PLATFORMTHEME to qt6ct

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I guess I mean color scheme, if they are using a different color scheme like Breeze Dark and they want to keep it, this path will unconditionally change it to DankMatugen. So we should add a gate for current color scheme, if it's a DMS one then we can flip it to dark/light


log.Info("Done")
return nil
}
Expand Down Expand Up @@ -875,6 +877,25 @@ func syncColorScheme(mode ColorMode) {
}
}

func applyKDEColorScheme(mode ColorMode) {
if !utils.CommandExists("plasma-apply-colorscheme") {
return
}

var scheme string
if mode == ColorModeLight {
scheme = "DankMatugenLight"
} else {
scheme = "DankMatugenDark"
}

log.Infof("Applying KDE color scheme: %s", scheme)
cmd := exec.Command("plasma-apply-colorscheme", scheme)
if err := cmd.Run(); err != nil {
log.Warnf("Failed to apply KDE color scheme: %v", err)
}
}

var adwaitaAccents = []struct {
name string
colors []colorful.Color
Expand Down
2 changes: 1 addition & 1 deletion quickshell/Modules/Settings/ThemeColorsTab.qml
Original file line number Diff line number Diff line change
Expand Up @@ -2488,7 +2488,7 @@ Item {
options: cachedIconThemes
onValueChanged: value => {
SettingsData.setIconTheme(value);
if (Quickshell.env("QT_QPA_PLATFORMTHEME") != "gtk3" && Quickshell.env("QT_QPA_PLATFORMTHEME") != "qt6ct" && Quickshell.env("QT_QPA_PLATFORMTHEME_QT6") != "qt6ct") {
if (Quickshell.env("QT_QPA_PLATFORMTHEME") != "gtk3" && Quickshell.env("QT_QPA_PLATFORMTHEME") != "qt6ct" && Quickshell.env("QT_QPA_PLATFORMTHEME_QT6") != "qt6ct" && Quickshell.env("QT_QPA_PLATFORMTHEME") != "kde") {
ToastService.showError(I18n.tr("Missing Environment Variables", "qt theme env error title"), I18n.tr("You need to set either:\nQT_QPA_PLATFORMTHEME=gtk3 OR\nQT_QPA_PLATFORMTHEME=qt6ct\nas environment variables, and then restart the shell.\n\nqt6ct requires qt6ct-kde to be installed.", "qt theme env error body"));
}
}
Expand Down
Loading