From e9f803b8a53d2063de2db8de277bb13c3511ccb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Zanghelini?= Date: Tue, 14 Oct 2025 01:34:38 -0300 Subject: [PATCH 1/2] Don't scroll when deleting clipboard history items --- .../ii/modules/overview/SearchWidget.qml | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/.config/quickshell/ii/modules/overview/SearchWidget.qml b/.config/quickshell/ii/modules/overview/SearchWidget.qml index 3121773d5..28285a8aa 100644 --- a/.config/quickshell/ii/modules/overview/SearchWidget.qml +++ b/.config/quickshell/ii/modules/overview/SearchWidget.qml @@ -187,6 +187,7 @@ Item { // Wrapper searchInput.text = searchInput.text.slice(0, searchInput.cursorPosition) + event.text + searchInput.text.slice(searchInput.cursorPosition); searchInput.cursorPosition += 1; event.accepted = true; + root.focusFirstItem(); } } } @@ -315,9 +316,7 @@ Item { // Wrapper model: ScriptModel { id: model - onValuesChanged: { - root.focusFirstItem(); - } + objectProp: "key" values: { // Search results are handled here ////////////////// Skip? ////////////////// @@ -334,11 +333,13 @@ Item { // Wrapper if (mightBlurImage) { shouldBlurImage = shouldBlurImage && (containsUnsafeLink(array[index - 1]) || containsUnsafeLink(array[index + 1])); } + const type = `#${entry.match(/^\s*(\S+)/)?.[1] || ""}` return { + key: type, cliphistRawString: entry, name: StringUtils.cleanCliphistEntry(entry), clickActionName: "", - type: `#${entry.match(/^\s*(\S+)/)?.[1] || ""}`, + type: type, execute: () => { Cliphist.copy(entry) }, @@ -367,9 +368,11 @@ Item { // Wrapper // Clipboard const searchString = StringUtils.cleanPrefix(root.searchingText, Config.options.search.prefix.emojis); return Emojis.fuzzyQuery(searchString).map(entry => { + const emoji = entry.match(/^\s*(\S+)/)?.[1] || "" return { + key: emoji, cliphistRawString: entry, - bigText: entry.match(/^\s*(\S+)/)?.[1] || "", + bigText: emoji, name: entry.replace(/^\s*\S+\s+/, ""), clickActionName: "", type: "Emoji", @@ -383,6 +386,7 @@ Item { // Wrapper ////////////////// Init /////////////////// nonAppResultsTimer.restart(); const mathResultObject = { + key: `Math result: ${root.mathResult}`, name: root.mathResult, clickActionName: Translation.tr("Copy"), type: Translation.tr("Math result"), @@ -395,9 +399,11 @@ Item { // Wrapper const appResultObjects = AppSearch.fuzzyQuery(StringUtils.cleanPrefix(root.searchingText, Config.options.search.prefix.app)).map(entry => { entry.clickActionName = Translation.tr("Launch"); entry.type = Translation.tr("App"); + entry.key = entry.execute return entry; }) const commandResultObject = { + key: `cmd /${root.searchingText}`, name: StringUtils.cleanPrefix(root.searchingText, Config.options.search.prefix.shellCommand).replace("file://", ""), clickActionName: Translation.tr("Run"), type: Translation.tr("Run command"), @@ -413,6 +419,7 @@ Item { // Wrapper } }; const webSearchResultObject = { + key: `website ${root.searchingText}`, name: StringUtils.cleanPrefix(root.searchingText, Config.options.search.prefix.webSearch), clickActionName: Translation.tr("Search"), type: Translation.tr("Search the web"), @@ -430,6 +437,7 @@ Item { // Wrapper const actionString = `${Config.options.search.prefix.action}${action.action}`; if (actionString.startsWith(root.searchingText) || root.searchingText.startsWith(actionString)) { return { + key: `Action ${actionString}`, name: root.searchingText.startsWith(actionString) ? root.searchingText : actionString, clickActionName: Translation.tr("Run"), type: Translation.tr("Action"), From b4d89b66f52048633cb74255c7e1938dcc1d86a2 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Tue, 14 Oct 2025 09:21:18 +0200 Subject: [PATCH 2/2] Fix command key formatting in SearchWidget.qml --- .config/quickshell/ii/modules/overview/SearchWidget.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.config/quickshell/ii/modules/overview/SearchWidget.qml b/.config/quickshell/ii/modules/overview/SearchWidget.qml index 28285a8aa..dc4a61d2c 100644 --- a/.config/quickshell/ii/modules/overview/SearchWidget.qml +++ b/.config/quickshell/ii/modules/overview/SearchWidget.qml @@ -403,7 +403,7 @@ Item { // Wrapper return entry; }) const commandResultObject = { - key: `cmd /${root.searchingText}`, + key: `cmd ${root.searchingText}`, name: StringUtils.cleanPrefix(root.searchingText, Config.options.search.prefix.shellCommand).replace("file://", ""), clickActionName: Translation.tr("Run"), type: Translation.tr("Run command"),