wallust integration

This commit is contained in:
Zacharias-Brohn
2025-11-13 01:56:43 +01:00
parent 374842b321
commit 52a382b0ad
5 changed files with 43 additions and 8 deletions
+2
View File
@@ -10,6 +10,7 @@ Singleton {
property alias accentColor: adapter.accentColor property alias accentColor: adapter.accentColor
property alias wallpaperPath: adapter.wallpaperPath property alias wallpaperPath: adapter.wallpaperPath
property alias maxWallpapers: adapter.maxWallpapers property alias maxWallpapers: adapter.maxWallpapers
property alias wallust: adapter.wallust
FileView { FileView {
id: root id: root
@@ -29,6 +30,7 @@ Singleton {
property string baseBgColor: "#801a1a1a" property string baseBgColor: "#801a1a1a"
property AccentColor accentColor: AccentColor {} property AccentColor accentColor: AccentColor {}
property int maxWallpapers: 7 property int maxWallpapers: 7
property bool wallust: false
} }
} }
} }
+4
View File
@@ -2,6 +2,7 @@ import Quickshell
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import qs.Helpers import qs.Helpers
import qs.Config
TextField { TextField {
id: root id: root
@@ -83,6 +84,9 @@ TextField {
launcherWindow.visible = false; launcherWindow.visible = false;
} else if ( wallpaperPickerLoader.active ) { } else if ( wallpaperPickerLoader.active ) {
WallpaperPath.currentWallpaperPath = wallpaperPickerLoader.item.currentItem.modelData.path; WallpaperPath.currentWallpaperPath = wallpaperPickerLoader.item.currentItem.modelData.path;
if ( Config.wallust ) {
Wallust.generateColors(WallpaperPath.currentWallpaperPath);
}
} }
event.accepted = true; event.accepted = true;
} else if ( event.key === Qt.Key_Escape ) { } else if ( event.key === Qt.Key_Escape ) {
+2 -3
View File
@@ -259,9 +259,8 @@ Scope {
return 0; return 0;
// Screen width - 4x outer rounding - 2x max side thickness (cause centered) // Screen width - 4x outer rounding - 2x max side thickness (cause centered)
const barMargins = 10; const margins = 10;
let outerMargins = 0; const maxWidth = screen.width - margins * 2;
const maxWidth = screen.width - (barMargins + outerMargins) * 2;
if ( maxWidth <= 0 ) if ( maxWidth <= 0 )
return 0; return 0;
+22
View File
@@ -0,0 +1,22 @@
pragma Singleton
import Quickshell
import Quickshell.Io
import QtQuick
Singleton {
id: root
property var args
function generateColors(wallpaperPath) {
root.args = wallpaperPath;
wallustProc.running = true;
}
Process {
id: wallustProc
command: ["wallust", "run", root.args, "--palette=dark16", "--ignore-sequence=cursor", "--threshold=9" ]
running: false
}
}
+8
View File
@@ -2,6 +2,7 @@ import Quickshell
import QtQuick import QtQuick
import Quickshell.Wayland import Quickshell.Wayland
import qs.Helpers import qs.Helpers
import qs.Modules
Scope { Scope {
Variants { Variants {
@@ -24,6 +25,13 @@ Scope {
anchors.fill: parent anchors.fill: parent
source: WallpaperPath.currentWallpaperPath source: WallpaperPath.currentWallpaperPath
fillMode: Image.PreserveAspectCrop fillMode: Image.PreserveAspectCrop
// Behavior on source {
// Anim {
// properties: "opacity"
// duration: 500
// }
// }
} }
} }
} }