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>
33 lines
1.3 KiB
QML
33 lines
1.3 KiB
QML
pragma Singleton
|
|
import QtQuick
|
|
import Quickshell
|
|
import "../services"
|
|
import "../services/AppMatching.js" as Matching
|
|
|
|
Singleton {
|
|
readonly property var options: ConfigService.ready ? ConfigService.data.dock : ({
|
|
enabled: false,
|
|
pinnedApps: [],
|
|
showRunningApps: true,
|
|
appOverrides: {}
|
|
})
|
|
readonly property var items: ConfigService.ready ? Matching.group(ApplicationsService.entries, HyprlandService.windows, options.pinnedApps, options.appOverrides, options.showRunningApps) : []
|
|
function find(id) {
|
|
return items.find(i => i.id === id) || null;
|
|
}
|
|
function pin(id) {
|
|
const entry = ApplicationsService.byId(id);
|
|
if (!entry)
|
|
return false;
|
|
if (options.pinnedApps.some(p => Matching.canonical(p) === Matching.canonical(entry.id)))
|
|
return true;
|
|
return ConfigService.setValue("dock.pinnedApps", options.pinnedApps.concat([Matching.canonical(entry.id) + ".desktop"]));
|
|
}
|
|
function unpin(id) {
|
|
return ConfigService.setValue("dock.pinnedApps", options.pinnedApps.filter(p => Matching.canonical(p) !== Matching.canonical(id)));
|
|
}
|
|
function reorder(source, target) {
|
|
return ConfigService.setValue("dock.pinnedApps", Matching.reorder(options.pinnedApps, source, target));
|
|
}
|
|
}
|