wallust integration
This commit is contained in:
@@ -2,6 +2,7 @@ import Quickshell
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import qs.Helpers
|
||||
import qs.Config
|
||||
|
||||
TextField {
|
||||
id: root
|
||||
@@ -83,6 +84,9 @@ TextField {
|
||||
launcherWindow.visible = false;
|
||||
} else if ( wallpaperPickerLoader.active ) {
|
||||
WallpaperPath.currentWallpaperPath = wallpaperPickerLoader.item.currentItem.modelData.path;
|
||||
if ( Config.wallust ) {
|
||||
Wallust.generateColors(WallpaperPath.currentWallpaperPath);
|
||||
}
|
||||
}
|
||||
event.accepted = true;
|
||||
} else if ( event.key === Qt.Key_Escape ) {
|
||||
|
||||
@@ -259,20 +259,19 @@ Scope {
|
||||
return 0;
|
||||
|
||||
// Screen width - 4x outer rounding - 2x max side thickness (cause centered)
|
||||
const barMargins = 10;
|
||||
let outerMargins = 0;
|
||||
const maxWidth = screen.width - (barMargins + outerMargins) * 2;
|
||||
const margins = 10;
|
||||
const maxWidth = screen.width - margins * 2;
|
||||
|
||||
if (maxWidth <= 0)
|
||||
if ( maxWidth <= 0 )
|
||||
return 0;
|
||||
|
||||
|
||||
const maxItemsOnScreen = Math.floor(maxWidth / itemWidth);
|
||||
const visible = Math.min(maxItemsOnScreen, Config.maxWallpapers, wallpaperModel.values.length);
|
||||
const maxItemsOnScreen = Math.floor( maxWidth / itemWidth );
|
||||
const visible = Math.min( maxItemsOnScreen, Config.maxWallpapers, wallpaperModel.values.length );
|
||||
|
||||
if (visible === 2)
|
||||
if ( visible === 2 )
|
||||
return 1;
|
||||
if (visible > 1 && visible % 2 === 0)
|
||||
if ( visible > 1 && visible % 2 === 0 )
|
||||
return visible - 1;
|
||||
return visible;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user