dms_tailscalectl/skills/dms-plugin-dev/templates/launcher/Launcher.qml
vybe 01ac7e9041 feat: add dms-plugin-dev agent skill for Dank Material Shell plugin development
- Introduces a general-purpose opencode skill to help agents build, debug, and publish DMS plugins.
- Includes orientation, decision trees (plugin types), condensed cheat sheets, ecosystem map, and four generic vertical-slice starter templates (bar widget, popout widget, launcher, desktop widget).
- Skill is versioned here for this project while remaining available as a global opencode skill.
- Updated .gitignore to ignore globally-installed copies of the skill.

Written by AI agent working for @jtmorris. Model: grok-build-0.1.
2026-05-24 09:31:06 +00:00

63 lines
1.7 KiB
QML

import QtQuick
import Quickshell
import qs.Common
import qs.Services
QtObject {
id: root
property var pluginService: null
property string pluginId: "exampleLauncher"
signal itemsChanged
Component.onCompleted: {
// Example: load a trigger from settings if you want it configurable
if (pluginService) {
// trigger is usually set in plugin.json, but you can override at runtime
}
}
// Required for launcher plugins
function getItems(query) {
if (!query || query.trim().length === 0) {
return []
}
const q = query.trim().toLowerCase()
// Very simple demo: echo back what the user typed
return [{
name: "Echo: " + query,
icon: "material:search",
comment: "Demo launcher item — replace with real logic",
action: "copy:" + query,
categories: ["Example"]
}]
}
function executeItem(item) {
if (!item || !item.action) return
if (item.action.startsWith("copy:")) {
const text = item.action.substring(5)
Quickshell.execDetached(["dms", "cl", "copy", text])
ToastService.showInfo("Copied to clipboard")
}
}
// Optional but nice: context menu on right-click / Tab
function getContextMenuActions(item) {
if (!item) return []
return [
{
icon: "content_copy",
text: "Copy",
action: () => {
Quickshell.execDetached(["dms", "cl", "copy", item.action.substring(5)])
ToastService.showInfo("Copied")
}
}
]
}
}