mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-04-05 05:12:05 -04:00
meta: support async launcher plugins, cached GIFs, paste on launcher v2
action - Preparations for DankGifSearch plugin
This commit is contained in:
@@ -29,16 +29,7 @@ DankModal {
|
||||
property int activeImageLoads: 0
|
||||
readonly property int maxConcurrentLoads: 3
|
||||
readonly property bool clipboardAvailable: DMSService.isConnected && (DMSService.capabilities.length === 0 || DMSService.capabilities.includes("clipboard"))
|
||||
property bool wtypeAvailable: false
|
||||
|
||||
Process {
|
||||
id: wtypeCheck
|
||||
command: ["which", "wtype"]
|
||||
running: true
|
||||
onExited: exitCode => {
|
||||
clipboardHistoryModal.wtypeAvailable = (exitCode === 0);
|
||||
}
|
||||
}
|
||||
readonly property bool wtypeAvailable: SessionService.wtypeAvailable
|
||||
|
||||
Process {
|
||||
id: wtypeProcess
|
||||
|
||||
@@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import "Scorer.js" as Scorer
|
||||
@@ -41,6 +42,47 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: PluginService
|
||||
function onRequestLauncherUpdate(pluginId) {
|
||||
if (activePluginId === pluginId || searchQuery) {
|
||||
performSearch();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: wtypeProcess
|
||||
command: ["wtype", "-M", "ctrl", "-P", "v", "-p", "v", "-m", "ctrl"]
|
||||
running: false
|
||||
}
|
||||
|
||||
Timer {
|
||||
id: pasteTimer
|
||||
interval: 200
|
||||
repeat: false
|
||||
onTriggered: wtypeProcess.running = true
|
||||
}
|
||||
|
||||
function pasteSelected() {
|
||||
if (!selectedItem)
|
||||
return;
|
||||
if (!SessionService.wtypeAvailable) {
|
||||
ToastService.showError("wtype not available - install wtype for paste support");
|
||||
return;
|
||||
}
|
||||
|
||||
const pluginId = selectedItem.pluginId;
|
||||
if (!pluginId)
|
||||
return;
|
||||
const pasteText = AppSearchService.getPluginPasteText(pluginId, selectedItem.data);
|
||||
if (!pasteText)
|
||||
return;
|
||||
Quickshell.execDetached(["dms", "cl", "copy", pasteText]);
|
||||
itemExecuted();
|
||||
pasteTimer.start();
|
||||
}
|
||||
|
||||
readonly property var sectionDefinitions: [
|
||||
{
|
||||
id: "calculator",
|
||||
|
||||
@@ -209,6 +209,10 @@ FocusScope {
|
||||
return;
|
||||
case Qt.Key_Return:
|
||||
case Qt.Key_Enter:
|
||||
if (event.modifiers & Qt.ShiftModifier) {
|
||||
controller.pasteSelected();
|
||||
return;
|
||||
}
|
||||
if (actionPanel.expanded && actionPanel.selectedActionIndex > 0) {
|
||||
actionPanel.executeSelectedAction();
|
||||
} else {
|
||||
|
||||
@@ -109,6 +109,18 @@ Rectangle {
|
||||
color: Theme.primaryText
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
anchors.margins: Theme.spacingXS
|
||||
width: 40
|
||||
height: 16
|
||||
fillMode: Image.PreserveAspectFit
|
||||
source: root.item?.data?.attribution || ""
|
||||
visible: source !== ""
|
||||
opacity: 0.9
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user