From 9cf054a1c675a8b2f6468cb61e671a1151a92ada Mon Sep 17 00:00:00 2001 From: Zacharias-Brohn Date: Tue, 17 Feb 2026 17:12:34 +0100 Subject: [PATCH] launcher overhaul --- Bar.qml | 2 +- Helpers/WallpaperPath.qml | 2 +- Modules/CustomTextField.qml | 101 ----------------------------------- Modules/Lock/LockSurface.qml | 17 ++---- scripts/zshell.sh | 2 +- scripts/zshell.shr | 2 +- 6 files changed, 7 insertions(+), 119 deletions(-) delete mode 100644 Modules/CustomTextField.qml diff --git a/Bar.qml b/Bar.qml index e091ad3..6ccd7cc 100644 --- a/Bar.qml +++ b/Bar.qml @@ -82,7 +82,7 @@ Variants { HyprlandFocusGrab { id: focusGrab - active: visibilities.launcher || visibilities.sidebar || visibilities.dashboard || visibilities.osd + active: visibilities.launcher windows: [bar] onCleared: { visibilities.launcher = false; diff --git a/Helpers/WallpaperPath.qml b/Helpers/WallpaperPath.qml index 4dafb08..33e4e0d 100644 --- a/Helpers/WallpaperPath.qml +++ b/Helpers/WallpaperPath.qml @@ -12,7 +12,7 @@ Singleton { FileView { id: fileView - path: Quickshell.env("HOME") + "/.local/state/z-bar/wallpaper_path.json" + path: `${Paths.state}/wallpaper_path.json` watchChanges: true onFileChanged: reload() diff --git a/Modules/CustomTextField.qml b/Modules/CustomTextField.qml deleted file mode 100644 index 615ec83..0000000 --- a/Modules/CustomTextField.qml +++ /dev/null @@ -1,101 +0,0 @@ -import Quickshell -import QtQuick -import QtQuick.Controls -import qs.Helpers -import qs.Config -import qs.Paths - -TextField { - id: root - color: "white" - horizontalAlignment: Text.AlignLeft - echoMode: TextInput.Normal - placeholderText: qsTr("Search applications...") - background: null - renderType: TextInput.NativeRendering - - font.family: "Rubik" - - cursorDelegate: Rectangle { - id: cursor - - property bool disableBlink - - implicitWidth: 2 - color: "white" - radius: 2 - - Connections { - target: root - - function onCursorPositionChanged(): void { - if ( root.activeFocus && root.cursorVisible ) { - cursor.opacity = 1; - cursor.disableBlink = true; - enableBlink.restart(); - } - } - } - - Timer { - id: enableBlink - - interval: 100 - onTriggered: cursor.disableBlink = false - } - - Timer { - running: root.activeFocus && root.cursorVisible && !cursor.disableBlink - repeat: true - triggeredOnStart: true - interval: 500 - onTriggered: parent.opacity = parent.opacity === 1 ? 0 : 1 - } - - Binding { - when: !root.activeFocus || !root.cursorVisible - cursor.opacity: 0 - } - - Behavior on opacity { - Anim { - duration: 200 - } - } - } - - Keys.onPressed: { - if ( event.key === Qt.Key_Down ) { - if ( appListLoader.active ) { - appListLoader.item.decrementCurrentIndex(); - } else { - wallpaperPickerLoader.item.decrementCurrentIndex(); - } - event.accepted = true; - } else if ( event.key === Qt.Key_Up ) { - if ( appListLoader.active ) { - appListLoader.item.incrementCurrentIndex(); - } else { - wallpaperPickerLoader.item.incrementCurrentIndex(); - } - event.accepted = true; - } else if ( event.key === Qt.Key_Return || event.key === Qt.Key_Enter ) { - if ( appListLoader.active ) { - Search.launch(appListLoader.item.currentItem.modelData); - launcherWindow.visible = false; - } else if ( wallpaperPickerLoader.active ) { - SearchWallpapers.setWallpaper(wallpaperPickerLoader.item.currentItem.modelData.path) - if ( Config.general.wallust ) { - Wallust.generateColors(WallpaperPath.currentWallpaperPath); - } - closeAnim.start(); - } - event.accepted = true; - } else if ( event.key === Qt.Key_Escape ) { - if ( wallpaperPickerLoader.active ) - SearchWallpapers.stopPreview(); - closeAnim.start(); - event.accepted = true; - } - } -} diff --git a/Modules/Lock/LockSurface.qml b/Modules/Lock/LockSurface.qml index 8a1a5f1..2576e73 100644 --- a/Modules/Lock/LockSurface.qml +++ b/Modules/Lock/LockSurface.qml @@ -65,12 +65,6 @@ WlSessionLockSurface { to: 1 duration: Appearance.anim.durations.large } - Modules.Anim { - target: background - property: "opacity" - to: 0 - duration: Appearance.anim.durations.large - } SequentialAnimation { PauseAnimation { duration: Appearance.anim.durations.small @@ -94,12 +88,6 @@ WlSessionLockSurface { running: true - Modules.Anim { - target: background - property: "opacity" - to: 1 - duration: Appearance.anim.durations.large - } SequentialAnimation { ParallelAnimation { Modules.Anim { @@ -154,11 +142,12 @@ WlSessionLockSurface { CachingImage { id: background anchors.fill: parent - asynchronous: false + asynchronous: true path: WallpaperPath.currentWallpaperPath + opacity: 1 Component.onCompleted: { - console.log(source); + console.log(path); } } diff --git a/scripts/zshell.sh b/scripts/zshell.sh index 18d02ac..822302a 100755 --- a/scripts/zshell.sh +++ b/scripts/zshell.sh @@ -13,7 +13,7 @@ main() { done if [[ "$LOCK" = "true" ]]; then - hyprctl dispatch global zshell-lock:lock + hyprctl dispatch global zshell:lock else qs -n -d -p "$QML_ROOT/shell.qml" fi diff --git a/scripts/zshell.shr b/scripts/zshell.shr index 18d02ac..822302a 100755 --- a/scripts/zshell.shr +++ b/scripts/zshell.shr @@ -13,7 +13,7 @@ main() { done if [[ "$LOCK" = "true" ]]; then - hyprctl dispatch global zshell-lock:lock + hyprctl dispatch global zshell:lock else qs -n -d -p "$QML_ROOT/shell.qml" fi