1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-06-24 20:15:21 -04:00

plugins: add startupCheck function

This commit is contained in:
bbedward
2026-06-23 22:11:51 -04:00
parent 99cc3b8449
commit 8b94b149b2
9 changed files with 269 additions and 19 deletions
@@ -0,0 +1,22 @@
import QtQuick
import qs.Common
QtObject {
// Optional async dependency gate. Receives a done(result) callback:
// done(null) -> allow activation
// done("short message") -> block with a title only
// done({ title, details }) -> block with an expandable details body
// A synchronous variant (no argument, return the result) is also supported.
function check(done) {
Proc.runCommand("exampleStartupCheck.depCheck", ["which", "boregard"], (stdout, exitCode) => {
if (exitCode === 0) {
done(null);
return;
}
done({
"title": I18n.tr("boregard is required"),
"details": I18n.tr("The 'boregard' tool is not installed or not on your PATH.\n\nInstall it from https://danklinux.com, then re-enable this plugin.")
});
});
}
}
@@ -0,0 +1,38 @@
import QtQuick
import qs.Common
import qs.Widgets
import qs.Modules.Plugins
PluginComponent {
id: root
layerNamespacePlugin: "startup-check"
horizontalBarPill: Component {
Row {
spacing: Theme.spacingXS
DankIcon {
name: "verified_user"
size: root.iconSize
color: Theme.primary
anchors.verticalCenter: parent.verticalCenter
}
StyledText {
text: "boregard"
font.pixelSize: Theme.fontSizeSmall
color: Theme.surfaceText
anchors.verticalCenter: parent.verticalCenter
}
}
}
verticalBarPill: Component {
DankIcon {
name: "verified_user"
size: root.iconSize
color: Theme.primary
}
}
}
@@ -0,0 +1,14 @@
{
"id": "exampleStartupCheck",
"name": "Startup Check Example",
"description": "Demonstrates startupCheck - blocks activation when the 'boregard' dependency is missing",
"version": "1.0.0",
"author": "AvengeMedia",
"type": "widget",
"capabilities": ["dankbar-widget"],
"component": "./StartupCheckWidget.qml",
"startupCheck": "./StartupCheck.qml",
"icon": "verified_user",
"dependencies": ["boregard"],
"permissions": ["process"]
}