Initial commit of the Quickshell desktop suite: bar, dock, launcher, settings, Control Center, dashboard, OSD, lock screen, desktop widgets, plugin host with the vendored Noctalia/Omarchy compatibility layer, helpers, packaging, tests and phase documentation. Includes the optimization work so far: usage widgets and dashboard gauges no longer animate continuously, desktop widgets pause while covered, system controls stop flickering on background polls, dock app matching uses an indexed catalog, and workspace ghosts are created only for occupied slots. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
37 lines
1.2 KiB
QML
37 lines
1.2 KiB
QML
pragma Singleton
|
|
import QtQuick
|
|
import Quickshell
|
|
import "../core"
|
|
|
|
Singleton {
|
|
id: root
|
|
property var extensions: []
|
|
readonly property var commands: SettingsRegistry.pages.map(page => ({
|
|
id: page.command,
|
|
title: page.title,
|
|
description: page.description,
|
|
page: page.id,
|
|
available: page.available
|
|
})).concat(extensions)
|
|
// Extensions are registered by trusted QML code, never interpreted from search text.
|
|
function registerCommand(command) {
|
|
if (!command || !/^[a-z][a-z0-9-]*$/.test(command.id) || !command.title || typeof command.run !== "function" || commands.some(c => c.id === command.id))
|
|
return false;
|
|
extensions = extensions.concat([command]);
|
|
return true;
|
|
}
|
|
function unregisterCommand(id) {
|
|
extensions = extensions.filter(c => c.id !== id);
|
|
}
|
|
function execute(id) {
|
|
const command = commands.find(c => c.id === id);
|
|
if (!command)
|
|
return false;
|
|
if (command.run)
|
|
command.run();
|
|
else
|
|
ShellState.openSettings(command.page);
|
|
return true;
|
|
}
|
|
}
|