diff --git a/Helpers/SearchWallpapers.qml b/Helpers/SearchWallpapers.qml index b7cfaf9..f078521 100644 --- a/Helpers/SearchWallpapers.qml +++ b/Helpers/SearchWallpapers.qml @@ -2,10 +2,11 @@ pragma Singleton import Quickshell import Quickshell.Io +import ZShell.Models import qs.Config import qs.Modules import qs.Helpers -import ZShell.Models +import qs.Paths Searcher { id: root @@ -27,6 +28,7 @@ Searcher { function stopPreview(): void { showPreview = false; + Quickshell.execDetached(["python3", Quickshell.shellPath("scripts/SchemeColorGen.py"), `--path=${root.actualCurrent}`, `--thumbnail=${Paths.cache}/imagecache/thumbnail.jpg`, `--output=${Paths.state}/scheme.json`]); } list: wallpapers.entries diff --git a/Modules/CustomTextField.qml b/Modules/CustomTextField.qml index cbf0f48..4474599 100644 --- a/Modules/CustomTextField.qml +++ b/Modules/CustomTextField.qml @@ -85,8 +85,6 @@ TextField { launcherWindow.visible = false; } else if ( wallpaperPickerLoader.active ) { SearchWallpapers.setWallpaper(wallpaperPickerLoader.item.currentItem.modelData.path) - if ( Config.useDynamicColors ) - Quickshell.execDetached(["python3", Quickshell.shellPath("scripts/SchemeColorGen.py"), `--path=${wallpaperPickerLoader.item.currentItem.modelData.path}`, `--thumbnail=${Paths.cache}/imagecache/thumbnail.jpg`, `--output=${Paths.state}/scheme.json`]); if ( Config.wallust ) { Wallust.generateColors(WallpaperPath.currentWallpaperPath); } diff --git a/scripts/initialTitle.sh b/scripts/initialTitle.sh deleted file mode 100755 index 33bfaea..0000000 --- a/scripts/initialTitle.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/zsh - -raw="$(hyprctl activewindow)" - -json="$(echo "$raw" | jq -Rn ' - [ inputs - | sub("\r$"; "") - | select(test(":")) - | capture("^(?[^:]+):[ \t]*(?.*)$") - | .key |= ltrim - ] - | from_entries -')" - -title="$(echo "$json" | jq '.initialTitle')" - -echo "$title" diff --git a/testwindow/shell.qml b/testwindow/shell.qml deleted file mode 100644 index 0295dd7..0000000 --- a/testwindow/shell.qml +++ /dev/null @@ -1,78 +0,0 @@ -import Quickshell -import QtQuick - -FloatingWindow { - - title: "terminal" - - Rectangle { - id: root - width: 480 - height: 320 - - property int callsToUpdateMinimumWidth: 0 - property bool optimize: true - - property int currentTextModel: 0 - property var columnTexts: [ - ["Click on either", "rectangle above", "and note how the counter", "below updates", "significantly faster using the", "regular (non-optimized)", "implementation"], - ["The width", "of this column", "is", "no wider than the", "widest item"], - ["Note how using Qt.callLater()", "the minimum width is", "calculated a bare-minimum", "number", "of times"] - ] - - Text { - x: 20; y: 280 - text: "Times minimum width has been calculated: " + root.callsToUpdateMinimumWidth - } - - Row { - y: 25; spacing: 30; anchors.horizontalCenter: parent.horizontalCenter - Rectangle { - width: 200; height: 50; color: "lightgreen" - Text { text: "Optimized behavior\nusing Qt.callLater()"; anchors.centerIn: parent } - MouseArea { anchors.fill: parent; onClicked: { root.optimize = true; root.currentTextModel++ } } - } - Rectangle { - width: 200; height: 50; color: "lightblue" - Text { text: "Regular behavior"; anchors.centerIn: parent} - MouseArea { anchors.fill: parent; onClicked: { root.optimize = false; root.currentTextModel++ } } - } - } - - Column { - id: column - anchors.centerIn: parent - - onChildrenChanged: root.optimize ? Qt.callLater(updateMinimumWidth) : updateMinimumWidth() - - property int widestChild - function updateMinimumWidth() { - root.callsToUpdateMinimumWidth++ - var w = 0; - for (var i in children) { - var child = children[i]; - if (child.implicitWidth > w) { - w = child.implicitWidth; - } - } - - widestChild = w; - } - - Repeater { - id: repeater - model: root.columnTexts[root.currentTextModel%3] - delegate: Text { - id: text - required property string modelData - required property int index - color: "white" - text: modelData - width: column.widestChild - horizontalAlignment: Text.Center - Rectangle { anchors.fill: parent; z: -1; color: text.index%2 ? "gray" : "darkgray" } - } - } - } - } -}