scheme refactor

This commit is contained in:
Zacharias-Brohn
2026-02-19 13:05:30 +01:00
parent ee62e61b06
commit b701badbc7
6 changed files with 39 additions and 26 deletions
+5 -2
View File
@@ -122,8 +122,11 @@ Singleton {
return { return {
logo: general.logo, logo: general.logo,
wallpaperPath: general.wallpaperPath, wallpaperPath: general.wallpaperPath,
wallust: general.wallust, color: {
schemeGeneration: general.schemeGeneration, wallust: general.color.wallust,
mode: general.color.mode,
schemeGeneration: general.color.schemeGeneration,
},
apps: { apps: {
terminal: general.apps.terminal, terminal: general.apps.terminal,
audio: general.apps.audio, audio: general.apps.audio,
+7 -2
View File
@@ -4,11 +4,16 @@ import Quickshell
JsonObject { JsonObject {
property string logo: "" property string logo: ""
property string wallpaperPath: Quickshell.env("HOME") + "/Pictures/Wallpapers" property string wallpaperPath: Quickshell.env("HOME") + "/Pictures/Wallpapers"
property bool wallust: false property Color color: Color {}
property bool schemeGeneration: true
property Apps apps: Apps {} property Apps apps: Apps {}
property Idle idle: Idle {} property Idle idle: Idle {}
component Color: JsonObject {
property bool wallust: false
property bool schemeGeneration: true
property string mode: "dark"
}
component Apps: JsonObject { component Apps: JsonObject {
property list<string> terminal: ["kitty"] property list<string> terminal: ["kitty"]
property list<string> audio: ["pavucontrol"] property list<string> audio: ["pavucontrol"]
+2 -2
View File
@@ -27,14 +27,14 @@ Searcher {
function preview(path: string): void { function preview(path: string): void {
previewPath = path; previewPath = path;
if ( Config.general.schemeGeneration ) if ( Config.general.schemeGeneration )
Quickshell.execDetached(["sh", "-c", `zshell-cli scheme generate --image-path=${previewPath} --thumbnail-path=${Paths.cache}/imagecache/thumbnail.jpg --output=${Paths.state}/scheme.json --scheme=${Config.colors.schemeType}`]); Quickshell.execDetached(["sh", "-c", `zshell-cli scheme generate --image-path ${previewPath} --thumbnail-path ${Paths.cache}/imagecache/thumbnail.jpg --output ${Paths.state}/scheme.json --scheme ${Config.colors.schemeType} --mode ${Config.general.color.mode}`]);
showPreview = true; showPreview = true;
} }
function stopPreview(): void { function stopPreview(): void {
showPreview = false; showPreview = false;
if ( Config.general.schemeGeneration ) if ( Config.general.schemeGeneration )
Quickshell.execDetached(["sh", "-c", `zshell-cli scheme generate --image-path=${root.actualCurrent} --thumbnail-path=${Paths.cache}/imagecache/thumbnail.jpg --output=${Paths.state}/scheme.json --scheme=${Config.colors.schemeType}`]); Quickshell.execDetached(["sh", "-c", `zshell-cli scheme generate --image-path ${root.actualCurrent} --thumbnail-path ${Paths.cache}/imagecache/thumbnail.jpg --output ${Paths.state}/scheme.json --scheme ${Config.colors.schemeType} --mode ${Config.general.color.mode}`]);
} }
list: wallpapers.entries list: wallpapers.entries
+22 -12
View File
@@ -39,21 +39,31 @@ Item {
} }
} }
Image { ColoredIcon {
id: icon id: icon
property bool batteryHDPI: root.bar.screen.x < 0 && root.item.icon.includes("battery")
property bool nmHDPI: root.bar.screen.x < 0 && root.item.icon.includes("nm-")
anchors.centerIn: parent anchors.centerIn: parent
width: batteryHDPI ? 26 : ( nmHDPI ? 25 : 22 )
height: batteryHDPI ? 26 : ( nmHDPI ? 25 : 22 )
source: root.item.icon source: root.item.icon
mipmap: true implicitSize: 22
smooth: ( batteryHDPI || nmHDPI ) ? false : true color: DynamicColors.palette.m3onSurface
asynchronous: true layer.enabled: DynamicColors.light
sourceSize.width: ( batteryHDPI || nmHDPI ) ? 16 : 22
sourceSize.height: ( batteryHDPI || nmHDPI ) ? 16 : 22
fillMode: Image.PreserveAspectFit
} }
// Image {
// id: icon
//
// property bool batteryHDPI: root.bar.screen.x < 0 && root.item.icon.includes("battery")
// property bool nmHDPI: root.bar.screen.x < 0 && root.item.icon.includes("nm-")
//
// anchors.centerIn: parent
// width: batteryHDPI ? 26 : ( nmHDPI ? 25 : 22 )
// height: batteryHDPI ? 26 : ( nmHDPI ? 25 : 22 )
// source: root.item.icon
// mipmap: true
// smooth: ( batteryHDPI || nmHDPI ) ? false : true
// asynchronous: true
// sourceSize.width: ( batteryHDPI || nmHDPI ) ? 16 : 22
// sourceSize.height: ( batteryHDPI || nmHDPI ) ? 16 : 22
// fillMode: Image.PreserveAspectFit
// }
} }
-5
View File
@@ -92,11 +92,6 @@ def generate(
is_dark = mode.lower() == "dark" is_dark = mode.lower() == "dark"
if is_dark:
seed = Hct.from_hct(seed.hue, seed.chroma, min(seed.tone, 20))
else:
seed = Hct.from_hct(seed.hue, seed.chroma, max(seed.tone, 70))
scheme = Scheme( scheme = Scheme(
seed, seed,
is_dark, is_dark,