diff --git a/quickshell/Modals/DankLauncherV2/Controller.qml b/quickshell/Modals/DankLauncherV2/Controller.qml index c68c21f56..dc1405b09 100644 --- a/quickshell/Modals/DankLauncherV2/Controller.qml +++ b/quickshell/Modals/DankLauncherV2/Controller.qml @@ -2,7 +2,6 @@ pragma ComponentBehavior: Bound import QtQuick import Quickshell -import Quickshell.Io import qs.Common import qs.Services import "Scorer.js" as Scorer @@ -150,19 +149,6 @@ Item { } } - Process { - id: copyProcess - running: false - onExited: pasteTimer.start() - } - - Timer { - id: pasteTimer - interval: 200 - repeat: false - onTriggered: ClipboardService.sendPasteKeystroke() - } - function pasteSelected() { if (!selectedItem) return; @@ -185,8 +171,7 @@ Item { const pasteArgs = AppSearchService.getPluginPasteArgs(pluginId, selectedItem.data); if (!pasteArgs) return; - copyProcess.command = pasteArgs; - copyProcess.running = true; + ClipboardService.pasteAfterCommand(pasteArgs); itemExecuted(); } diff --git a/quickshell/Services/ClipboardService.qml b/quickshell/Services/ClipboardService.qml index 8bb0e3b6a..3deb1001e 100644 --- a/quickshell/Services/ClipboardService.qml +++ b/quickshell/Services/ClipboardService.qml @@ -3,6 +3,7 @@ pragma ComponentBehavior: Bound import QtQuick import Quickshell +import Quickshell.Io import Quickshell.Wayland import qs.Common import qs.Services @@ -47,6 +48,11 @@ Singleton { onTriggered: root.sendPasteKeystroke() } + Process { + id: pasteCommand + onExited: pasteTimer.start() + } + Connections { target: DMSService function onIsConnectedChanged() { @@ -74,6 +80,11 @@ Singleton { return terminalAppIds.includes(appId) || appId.endsWith("term") || appId.includes("terminal"); } + function pasteAfterCommand(command) { + pasteCommand.command = command; + pasteCommand.running = true; + } + function sendPasteKeystroke() { DMSService.sendRequest("clipboard.sendPaste", { "shift": isTerminalFocused()