diff --git a/core/internal/matugen/matugen.go b/core/internal/matugen/matugen.go index a29d324f2..dd4419150 100644 --- a/core/internal/matugen/matugen.go +++ b/core/internal/matugen/matugen.go @@ -181,6 +181,8 @@ func Run(opts Options) error { syncColorScheme(opts.Mode) } + applyKDEColorScheme(opts.Mode) + log.Info("Done") return nil } @@ -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 diff --git a/quickshell/Modules/Settings/ThemeColorsTab.qml b/quickshell/Modules/Settings/ThemeColorsTab.qml index 67650baff..678250bae 100644 --- a/quickshell/Modules/Settings/ThemeColorsTab.qml +++ b/quickshell/Modules/Settings/ThemeColorsTab.qml @@ -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")); } }