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>
73 lines
4.3 KiB
QML
73 lines
4.3 KiB
QML
pragma Singleton
|
|
import QtQuick
|
|
import Quickshell
|
|
import "../services"
|
|
Singleton {
|
|
// Shared pill height for bar modules: 36px, shrinking to fit shorter bars.
|
|
readonly property int pillHeight: ConfigService.ready ? Math.max(24, Math.min(36, ConfigService.data.bar.height - 6)) : 36
|
|
readonly property var modules: ({
|
|
cpu: Qt.resolvedUrl("../bar/modules/MetricsModule.qml"),
|
|
cpuTemperature: Qt.resolvedUrl("../bar/modules/MetricsModule.qml"),
|
|
gpu: Qt.resolvedUrl("../bar/modules/MetricsModule.qml"),
|
|
gpuTemperature: Qt.resolvedUrl("../bar/modules/MetricsModule.qml"),
|
|
ram: Qt.resolvedUrl("../bar/modules/MetricsModule.qml"),
|
|
storage: Qt.resolvedUrl("../bar/modules/MetricsModule.qml"),
|
|
networkThroughput: Qt.resolvedUrl("../bar/modules/MetricsModule.qml"),
|
|
activeWindow: Qt.resolvedUrl("../bar/modules/ActiveWindowModule.qml"),
|
|
cava: Qt.resolvedUrl("../bar/modules/CavaModule.qml"),
|
|
nowPlaying: Qt.resolvedUrl("../bar/modules/NowPlayingModule.qml"),
|
|
settings: Qt.resolvedUrl("../bar/modules/SettingsModule.qml"),
|
|
workspaces: Qt.resolvedUrl("../bar/modules/WorkspacesModule.qml"),
|
|
clock: Qt.resolvedUrl("../bar/modules/ClockModule.qml"),
|
|
tray: Qt.resolvedUrl("../bar/modules/TrayModule.qml"),
|
|
system: Qt.resolvedUrl("../bar/modules/SystemModule.qml"),
|
|
volume: Qt.resolvedUrl("../bar/modules/VolumeModule.qml")
|
|
})
|
|
// Installed plugin bar widgets are modules named "plugin:<id>".
|
|
function isPlugin(id) { return String(id).startsWith("plugin:"); }
|
|
function source(id) { return isPlugin(id) ? Qt.resolvedUrl("../bar/modules/PluginModule.qml") : modules[id] || ""; }
|
|
// Every module that can be added: built-ins plus enabled plugin widgets.
|
|
readonly property var available: Object.keys(modules).concat(PluginService.barModules)
|
|
// Readable names for the Settings → Bar editor.
|
|
readonly property var titles: ({
|
|
activeWindow: "Windows", cava: "Visualizer", clock: "Clock", cpu: "CPU", cpuTemperature: "CPU temp",
|
|
gpu: "GPU", gpuTemperature: "GPU temp", networkThroughput: "Network", nowPlaying: "Now playing",
|
|
ram: "Memory", settings: "Settings", storage: "Storage", system: "System", tray: "Tray",
|
|
volume: "Volume", workspaces: "Workspaces"
|
|
})
|
|
function title(id) { return isPlugin(id) ? PluginService.title(String(id).slice(7)) : titles[id] || id; }
|
|
// Per-module options edited from the cog on each card in Settings → Bar.
|
|
// Stored on the module entry, so per-screen layouts can differ.
|
|
readonly property var optionSchemas: ({
|
|
activeWindow: [
|
|
{ key: "transition", label: "On switch", choices: ["fade", "slide", "pop", "none"], fallback: "fade" },
|
|
{ key: "labels", label: "Names", choices: ["all", "focused", "icons"], fallback: "all" },
|
|
{ key: "collapse", label: "Icons after", choices: ["3", "4", "6", "never"], fallback: "3" },
|
|
{ key: "labelWidth", label: "Name width", choices: ["short", "medium", "long"], fallback: "medium" },
|
|
{ key: "preview", label: "Hover preview", choices: ["on", "off"], fallback: "on" }
|
|
]
|
|
})
|
|
// Modules whose options already live on a settings page: the cog jumps there.
|
|
readonly property var settingsLinks: ({
|
|
clock: { page: "bar", setting: "Show date" },
|
|
workspaces: { page: "bar", setting: "Workspace style" },
|
|
cava: { page: "media", setting: "Visualizer bars" },
|
|
nowPlaying: { page: "media", setting: "Now playing" },
|
|
tray: { page: "tray", setting: "" },
|
|
volume: { page: "osd", setting: "Step" },
|
|
system: { page: "controlcenter", setting: "" },
|
|
cpu: { page: "metrics", setting: "" },
|
|
cpuTemperature: { page: "metrics", setting: "" },
|
|
gpu: { page: "metrics", setting: "" },
|
|
gpuTemperature: { page: "metrics", setting: "" },
|
|
ram: { page: "metrics", setting: "" },
|
|
storage: { page: "metrics", setting: "" },
|
|
networkThroughput: { page: "metrics", setting: "" }
|
|
})
|
|
function option(entry, key) {
|
|
const schema = (optionSchemas[entry.id] || []).find(o => o.key === key);
|
|
const value = entry.options ? entry.options[key] : undefined;
|
|
return schema && schema.choices.includes(value) ? value : schema ? schema.fallback : value;
|
|
}
|
|
}
|