Predefined ColorSchemes

- added support for predefined color schemes
- moved all the code regarding colors generation from wallpaper to the
ColorSchemes service
This commit is contained in:
quadbyte 2025-08-15 15:37:00 -04:00
parent a8e7f6e01d
commit f5b4cb452b
9 changed files with 126 additions and 94 deletions

View file

@ -39,7 +39,7 @@ Singleton {
}
function setCurrentWallpaper(path, isInitial) {
// Only generate colors if the wallpaper actually changed
// Only regenerate colors if the wallpaper actually changed
var wallpaperChanged = currentWallpaper !== path
currentWallpaper = path
@ -64,9 +64,9 @@ Singleton {
randomWallpaperTimer.restart()
}
// Only generate colors if the wallpaper actually changed
// Only notify ColorSchemes service if the wallpaper actually changed
if (wallpaperChanged) {
generateColors()
ColorSchemes.changedWallpaper()
}
}
@ -95,14 +95,6 @@ Singleton {
}
}
function generateColors() {
console.log("[Wallpapers] generateColors() called, generateColors setting:", Settings.data.wallpaper.generateColors)
if (Settings.data.wallpaper.generateColors) {
console.log("[Wallpapers] Starting color generation process")
generateThemeProcess.running = true
}
}
function startSWWWDaemon() {
if (Settings.data.wallpaper.swww.enabled) {
console.log("[SWWW] Requesting swww-daemon")
@ -160,25 +152,6 @@ Singleton {
}
}
Process {
id: generateThemeProcess
command: ["matugen", "image", currentWallpaper, "--config", Quickshell.shellDir + "/Assets/Matugen/matugen.toml"]
workingDirectory: Quickshell.shellDir
running: false
stdout: StdioCollector {
onStreamFinished: {
console.log("[Wallpapers] generated colors from image")
}
}
stderr: StdioCollector {
onStreamFinished: {
if (this.text !== "") {
console.error(this.text)
}
}
}
}
Process {
id: startDaemonProcess
command: ["swww-daemon", "--format", "xrgb"]