Add glassMxrph shell sources
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>
This commit is contained in:
commit
99e64a7713
433 files changed
+57792
No files matched your search
@@ -0,0 +1,56 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import "../services"
|
||||
import "../theme"
|
||||
|
||||
// Caelestia-style drawers: popups that grow out of the bar's bottom edge as one
|
||||
// continuous shape. Drawers register the span they occupy so the bar can open
|
||||
// its border there; geometry helpers keep every drawer on the bar's straight edge.
|
||||
Singleton {
|
||||
id: root
|
||||
readonly property int margin: ConfigService.ready ? ConfigService.data.bar.margin : 10
|
||||
readonly property int height: ConfigService.ready ? ConfigService.data.bar.height : 48
|
||||
// Screen y of the bar's bottom edge, where drawers attach.
|
||||
readonly property int bottom: margin + height
|
||||
readonly property real radius: Math.min(Theme.radius, height / 2)
|
||||
// Concave fillet joining a drawer to the bar.
|
||||
readonly property real ear: Math.max(8, Math.min(18, Theme.radius * 0.8))
|
||||
// The bar window reaches this far below the bar so its glass edge never
|
||||
// lands on the join (HyprGlass refracts at layer box edges).
|
||||
readonly property int overhang: 28
|
||||
// screen name -> [{id, x0, x1}] in screen coordinates.
|
||||
property var gaps: ({})
|
||||
function setGap(id, screenName, x0, x1) {
|
||||
const next = Object.assign({}, gaps);
|
||||
for (const key in next)
|
||||
next[key] = next[key].filter(g => g.id !== id);
|
||||
if (screenName)
|
||||
next[screenName] = (next[screenName] || []).concat([
|
||||
{
|
||||
id: id,
|
||||
x0: x0,
|
||||
x1: x1
|
||||
}
|
||||
]);
|
||||
gaps = next;
|
||||
}
|
||||
function clearGap(id) {
|
||||
setGap(id, "", 0, 0);
|
||||
}
|
||||
function gapsFor(screenName) {
|
||||
return gaps[screenName] || [];
|
||||
}
|
||||
// Left edge (screen x) for a drawer of `outerWidth` (body plus both ears)
|
||||
// centred on `centerX`, kept within the bar's straight bottom edge.
|
||||
function clampX(centerX, outerWidth, screenWidth) {
|
||||
const lo = margin + radius, hi = screenWidth - margin - radius - outerWidth;
|
||||
return Math.round(Math.max(lo, Math.min(centerX - outerWidth / 2, hi)));
|
||||
}
|
||||
function leftX() {
|
||||
return Math.round(margin + radius);
|
||||
}
|
||||
function rightX(outerWidth, screenWidth) {
|
||||
return Math.round(screenWidth - margin - radius - outerWidth);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import "../services"
|
||||
|
||||
// Bar module layouts. Screens listed in `bar.screens` have their own module
|
||||
// list (e.g. a narrow vertical monitor); every other screen uses `bar.modules`.
|
||||
Singleton {
|
||||
id: root
|
||||
readonly property var screens: ConfigService.ready ? (ConfigService.data.bar.screens || ({})) : ({})
|
||||
function hasOwn(screenName) {
|
||||
return !!screenName && !!screens[screenName] && Array.isArray(screens[screenName].modules);
|
||||
}
|
||||
function modulesFor(screenName) {
|
||||
if (!ConfigService.ready)
|
||||
return [];
|
||||
return hasOwn(screenName) ? screens[screenName].modules : ConfigService.data.bar.modules;
|
||||
}
|
||||
// Saves to the screen's own layout when it has one, else the shared layout.
|
||||
function save(screenName, modules) {
|
||||
if (!hasOwn(screenName))
|
||||
return ConfigService.setValue("bar.modules", modules);
|
||||
const next = Object.assign({}, screens);
|
||||
next[screenName] = Object.assign({}, next[screenName], {
|
||||
modules: modules
|
||||
});
|
||||
return ConfigService.setValue("bar.screens", next);
|
||||
}
|
||||
// A new screen layout starts as a copy of the shared one.
|
||||
function setOwn(screenName, own) {
|
||||
if (!screenName || own === hasOwn(screenName))
|
||||
return false;
|
||||
const next = Object.assign({}, screens);
|
||||
if (own)
|
||||
next[screenName] = {
|
||||
modules: ConfigService.data.bar.modules.map(m => Object.assign({}, m))
|
||||
};
|
||||
else
|
||||
delete next[screenName];
|
||||
return ConfigService.setValue("bar.screens", next);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
// Dashboard tabs. Order and visibility come from `dashboard.tabs` in the config.
|
||||
Singleton {
|
||||
readonly property var tabs: ({
|
||||
dashboard: {
|
||||
title: "Dashboard",
|
||||
description: "User, clock, calendar, resources and now playing",
|
||||
glyph: "",
|
||||
fallback: "◫",
|
||||
source: Qt.resolvedUrl("../dashboard/tabs/OverviewTab.qml")
|
||||
},
|
||||
media: {
|
||||
title: "Media",
|
||||
description: "Player controls and the EasyEffects equalizer",
|
||||
glyph: "",
|
||||
fallback: "♪",
|
||||
source: Qt.resolvedUrl("../dashboard/tabs/MediaTab.qml")
|
||||
},
|
||||
performance: {
|
||||
title: "Performance",
|
||||
description: "CPU, GPU, memory, storage and network",
|
||||
glyph: "",
|
||||
fallback: "%",
|
||||
source: Qt.resolvedUrl("../dashboard/tabs/PerformanceTab.qml")
|
||||
},
|
||||
power: {
|
||||
title: "Power",
|
||||
description: "Lock, restart and shut down",
|
||||
glyph: "",
|
||||
fallback: "⏻",
|
||||
source: Qt.resolvedUrl("../dashboard/tabs/PowerTab.qml")
|
||||
}
|
||||
})
|
||||
function entry(id) {
|
||||
return tabs[id] || null;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,141 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import "../services"
|
||||
|
||||
// Shared bar hover popout (Caelestia-style): one surface that morphs between
|
||||
// anchors. The first hover waits for the hover delay; once a popout or tray menu
|
||||
// is open, hovering another anchor switches to it immediately.
|
||||
Singleton {
|
||||
id: root
|
||||
property bool open: false
|
||||
property Item anchor: null
|
||||
property string kind: ""
|
||||
property string text: ""
|
||||
// Kind-specific data, e.g. the window a preview shows.
|
||||
property var payload: null
|
||||
property bool popoutHovered: false
|
||||
property Item hoveredAnchor: null
|
||||
property var pending: null
|
||||
property var window: null
|
||||
// A popout or a tray menu is already showing, so the next hover is instant.
|
||||
readonly property bool warm: open || TrayService.opened
|
||||
readonly property int delay: TrayService.options.hoverDelay
|
||||
|
||||
function hover(anchor, kind, text, payload) {
|
||||
hoveredAnchor = anchor;
|
||||
leave.stop();
|
||||
pending = {
|
||||
anchor: anchor,
|
||||
kind: kind,
|
||||
text: text || "",
|
||||
payload: payload === undefined ? null : payload
|
||||
};
|
||||
if (!kind) {
|
||||
intent.stop();
|
||||
if (open)
|
||||
close();
|
||||
} else if (warm)
|
||||
show();
|
||||
else
|
||||
intent.restart();
|
||||
}
|
||||
function unhover(anchor) {
|
||||
if (hoveredAnchor === anchor)
|
||||
hoveredAnchor = null;
|
||||
if (pending && pending.anchor === anchor && !open)
|
||||
intent.stop();
|
||||
leave.restart();
|
||||
}
|
||||
function toggle(anchor, kind, text, payload) {
|
||||
if (open && root.anchor === anchor)
|
||||
return close();
|
||||
pending = {
|
||||
anchor: anchor,
|
||||
kind: kind,
|
||||
text: text || "",
|
||||
payload: payload === undefined ? null : payload
|
||||
};
|
||||
show();
|
||||
}
|
||||
function show() {
|
||||
const p = pending;
|
||||
intent.stop();
|
||||
if (!p || !p.anchor || !p.kind)
|
||||
return;
|
||||
anchor = p.anchor;
|
||||
kind = p.kind;
|
||||
text = p.text;
|
||||
payload = p.payload;
|
||||
open = true;
|
||||
TrayService.close();
|
||||
}
|
||||
function close() {
|
||||
open = false;
|
||||
intent.stop();
|
||||
leave.stop();
|
||||
}
|
||||
function setPopoutHovered(inside) {
|
||||
popoutHovered = inside;
|
||||
if (inside)
|
||||
leave.stop();
|
||||
else
|
||||
leave.restart();
|
||||
}
|
||||
onAnchorChanged: if (!anchor)
|
||||
close()
|
||||
Timer {
|
||||
id: intent
|
||||
interval: root.delay
|
||||
onTriggered: if (root.hoveredAnchor && root.pending && root.pending.anchor === root.hoveredAnchor)
|
||||
root.show()
|
||||
}
|
||||
// Grace period for crossing the gap between the bar and the popout.
|
||||
Timer {
|
||||
id: leave
|
||||
interval: 260
|
||||
onTriggered: if (!root.hoveredAnchor && !root.popoutHovered)
|
||||
root.close()
|
||||
}
|
||||
Connections {
|
||||
target: TrayService
|
||||
function onOpenedChanged() {
|
||||
if (TrayService.opened)
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: ShellState
|
||||
function onControlCenterOpenChanged() {
|
||||
if (ShellState.controlCenterOpen)
|
||||
root.close();
|
||||
}
|
||||
function onSettingsOpenChanged() {
|
||||
if (ShellState.settingsOpen)
|
||||
root.close();
|
||||
}
|
||||
function onLauncherOpenChanged() {
|
||||
if (ShellState.launcherOpen)
|
||||
root.close();
|
||||
}
|
||||
}
|
||||
IpcHandler {
|
||||
target: "popout"
|
||||
function close(): void {
|
||||
root.close();
|
||||
}
|
||||
function status(): string {
|
||||
return JSON.stringify({
|
||||
open: root.open,
|
||||
kind: root.kind,
|
||||
text: root.text,
|
||||
anchor: root.anchor ? root.anchor.objectName : "",
|
||||
visible: !!root.window && root.window.visible,
|
||||
screen: root.window && root.window.screen ? root.window.screen.name : "",
|
||||
width: root.window ? root.window.implicitWidth : 0,
|
||||
height: root.window ? root.window.implicitHeight : 0
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
import Quickshell.Hyprland
|
||||
|
||||
Singleton {
|
||||
id: root
|
||||
property string focusedName: ""
|
||||
Connections {
|
||||
target: Hyprland
|
||||
function onRawEvent(event) {
|
||||
if (event.name === "focusedmon" || event.name === "focusedmonv2")
|
||||
root.focusedName = event.parse(2)[0];
|
||||
}
|
||||
}
|
||||
readonly property var active: Quickshell.screens.find(s => s.name === (focusedName || (Hyprland.focusedMonitor ? Hyprland.focusedMonitor.name : ""))) || primary
|
||||
readonly property var primary: Quickshell.screens.find(s => s.x === 0 && s.y === 0) || Quickshell.screens[0] || null
|
||||
function current(candidate) {
|
||||
return Quickshell.screens.find(s => s === candidate) || active;
|
||||
}
|
||||
function resolve(name) {
|
||||
return (name === "primary" ? primary : Quickshell.screens.find(s => s.name === name)) || primary;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,293 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
Singleton {
|
||||
// Sidebar groups, in display order.
|
||||
readonly property var groups: [
|
||||
{
|
||||
id: "info",
|
||||
title: ""
|
||||
},
|
||||
{
|
||||
id: "personalize",
|
||||
title: "Personalize"
|
||||
},
|
||||
{
|
||||
id: "shell",
|
||||
title: "Shell"
|
||||
},
|
||||
{
|
||||
id: "system",
|
||||
title: "System"
|
||||
}
|
||||
]
|
||||
// `keywords` lists setting titles on the page; search results jump to and highlight them.
|
||||
readonly property var pages: [
|
||||
{
|
||||
id: "appearance",
|
||||
title: "Appearance",
|
||||
command: "appearance",
|
||||
description: "Accent, glass and motion",
|
||||
phase: 5,
|
||||
available: true,
|
||||
group: "personalize",
|
||||
icon: "",
|
||||
keywords: ["Accent source", "Custom accent", "Matugen", "Scheme", "Contrast", "Glass tint", "Regenerate on wallpaper change", "Glass opacity", "Panel opacity", "Border opacity", "Corner radius", "Animation duration", "Animation intensity", "Reduced motion", "Shadows", "Glass highlights", "HyprGlass", "Blur", "Refraction", "Vibrancy"]
|
||||
},
|
||||
{
|
||||
id: "wallpaper",
|
||||
title: "Wallpaper",
|
||||
command: "wallpaper",
|
||||
description: "Wallpaper picker and palette generation",
|
||||
phase: 5,
|
||||
available: true,
|
||||
group: "personalize",
|
||||
icon: "",
|
||||
keywords: ["Wallpaper picker", "Apply to monitor", "Backend", "Palette monitor", "Wallpaper folders", "Gallery"]
|
||||
},
|
||||
{
|
||||
id: "widgets",
|
||||
title: "Desktop widgets",
|
||||
command: "widgets",
|
||||
description: "Clocks, system usage, weather and more on the desktop",
|
||||
phase: 9,
|
||||
available: true,
|
||||
group: "personalize",
|
||||
icon: "",
|
||||
keywords: ["Edit widgets", "Add widget", "Snap to grid", "Clock widget", "Calendar", "Weather", "Note", "Visualizer"]
|
||||
},
|
||||
{
|
||||
id: "bar",
|
||||
title: "Bar",
|
||||
command: "bar",
|
||||
description: "Bar modules and tray preferences",
|
||||
phase: 5,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Bar height", "Margin", "Modules", "Show date", "24-hour time", "Show seconds", "Workspace count", "Workspace style", "Pacman", "Roman numerals", "Clock"]
|
||||
},
|
||||
{
|
||||
id: "tray",
|
||||
title: "Bar / Tray",
|
||||
command: "tray",
|
||||
description: "Tray icons and application menus",
|
||||
phase: 2,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["System tray", "Hover menus", "Hover delay", "Icon size", "Spacing", "Background"]
|
||||
},
|
||||
{
|
||||
id: "dock",
|
||||
title: "Dock",
|
||||
command: "dock",
|
||||
description: "Pinned apps, visibility and placement",
|
||||
phase: 3,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Enable dock", "Monitor", "Position", "Visibility", "Icon size", "Spacing", "Margin", "Magnification", "Magnification strength", "Animation speed", "Show running apps", "Running indicators", "Tooltips", "Terminal launcher", "Pinned applications"]
|
||||
},
|
||||
{
|
||||
id: "launcher",
|
||||
title: "Launcher",
|
||||
command: "launcher",
|
||||
description: "Search and command palette preferences",
|
||||
phase: 4,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Width", "Maximum results", "Show descriptions"]
|
||||
},
|
||||
{
|
||||
id: "controlcenter",
|
||||
title: "Control Center",
|
||||
command: "controlcenter",
|
||||
description: "System controls and modules",
|
||||
phase: 7,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Panel width", "Modules"]
|
||||
},
|
||||
{
|
||||
id: "dashboard",
|
||||
title: "Dashboard",
|
||||
command: "dashboard",
|
||||
description: "Tabbed dashboard: overview, media, performance and power",
|
||||
phase: 9,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Dashboard", "Placement", "Position", "Tab order", "Open from clock", "Remember last tab", "Equalizer", "EasyEffects", "Power menu"]
|
||||
},
|
||||
{
|
||||
id: "plugins",
|
||||
title: "Plugins",
|
||||
command: "plugins",
|
||||
description: "Omarchy and Noctalia plugins in the glassMxrph style",
|
||||
phase: 9,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Plugins", "Install plugin", "Omarchy", "Noctalia", "Marketplace", "Add to bar", "Remove plugin"]
|
||||
},
|
||||
{
|
||||
id: "osd",
|
||||
title: "On-screen display",
|
||||
command: "osd",
|
||||
description: "Volume and brightness overlay",
|
||||
phase: 9,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Animation", "OSD", "Volume overlay", "Show overlay", "Position", "Duration", "Step"]
|
||||
},
|
||||
{
|
||||
id: "media",
|
||||
title: "Media",
|
||||
command: "media",
|
||||
description: "Music widget and player preferences",
|
||||
phase: 6,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Now playing", "Visualizer", "Cava", "Visualizer bars", "Visualizer style", "Hide while paused", "Album artwork", "Track progress", "Album name", "Visualizer in cards", "Preferred player"]
|
||||
},
|
||||
{
|
||||
id: "metrics",
|
||||
title: "System Metrics",
|
||||
command: "metrics",
|
||||
description: "Sensors, desktop widget and diagnostics",
|
||||
phase: 8,
|
||||
available: true,
|
||||
group: "shell",
|
||||
icon: "",
|
||||
keywords: ["Desktop widget", "Monitor", "Position", "Widget scale", "Sampling interval", "GPU", "Network interface", "Storage paths"]
|
||||
},
|
||||
{
|
||||
id: "displays",
|
||||
title: "Displays",
|
||||
command: "display",
|
||||
description: "Display preferences",
|
||||
phase: 5,
|
||||
available: true,
|
||||
group: "system",
|
||||
icon: "",
|
||||
keywords: ["Brightness", "Backlight device", "Night Light", "Night temperature", "Providers"]
|
||||
},
|
||||
{
|
||||
id: "audio",
|
||||
title: "Audio",
|
||||
command: "audio",
|
||||
description: "Playback and microphone controls",
|
||||
phase: 7,
|
||||
available: true,
|
||||
group: "system",
|
||||
icon: "",
|
||||
keywords: ["Volume", "Microphone", "Output device", "Input device"]
|
||||
},
|
||||
{
|
||||
id: "network",
|
||||
title: "Network",
|
||||
command: "network",
|
||||
description: "Network connections",
|
||||
phase: 7,
|
||||
available: true,
|
||||
group: "system",
|
||||
icon: "",
|
||||
keywords: ["Wi-Fi", "Advanced connections", "VPN"]
|
||||
},
|
||||
{
|
||||
id: "bluetooth",
|
||||
title: "Bluetooth",
|
||||
command: "bluetooth",
|
||||
description: "Bluetooth devices",
|
||||
phase: 7,
|
||||
available: true,
|
||||
group: "system",
|
||||
icon: "",
|
||||
keywords: ["Adapter", "Devices", "Pairing"]
|
||||
},
|
||||
{
|
||||
id: "lock",
|
||||
title: "Lock screen",
|
||||
command: "lock",
|
||||
description: "Glass lock screen and password check",
|
||||
phase: 9,
|
||||
available: true,
|
||||
group: "system",
|
||||
icon: "",
|
||||
keywords: ["Lock now", "Preview lock screen", "Test password", "Backdrop", "Glass", "PAM", "Now Playing on lock screen", "Power buttons"]
|
||||
},
|
||||
{
|
||||
id: "notifications",
|
||||
title: "Notifications",
|
||||
command: "notifications",
|
||||
description: "Notification preferences",
|
||||
phase: 5,
|
||||
available: true,
|
||||
group: "system",
|
||||
icon: "",
|
||||
keywords: ["Do not disturb"]
|
||||
},
|
||||
{
|
||||
id: "power",
|
||||
title: "Power",
|
||||
command: "power",
|
||||
description: "Power preferences",
|
||||
phase: 7,
|
||||
available: true,
|
||||
group: "system",
|
||||
icon: "",
|
||||
keywords: ["Power profile", "Lock command", "Suspend", "Reboot", "Shut down"]
|
||||
},
|
||||
{
|
||||
id: "about",
|
||||
title: "GlassMxrph",
|
||||
command: "about",
|
||||
description: "About glassMxrph, versions and environment",
|
||||
phase: 1,
|
||||
available: true,
|
||||
group: "info",
|
||||
icon: "",
|
||||
image: Qt.resolvedUrl("../assets/glassmxrph-256.png"),
|
||||
keywords: ["About", "Version", "GlassMxrph"]
|
||||
}
|
||||
]
|
||||
function page(id) {
|
||||
return pages.find(p => p.id === id || p.command === id) || null;
|
||||
}
|
||||
// Page and setting matches for the settings search, best first.
|
||||
function search(text) {
|
||||
const query = String(text || "").trim().toLowerCase();
|
||||
if (!query)
|
||||
return [];
|
||||
const results = [];
|
||||
for (const p of pages) {
|
||||
const title = p.title.toLowerCase();
|
||||
if (title.includes(query) || p.description.toLowerCase().includes(query))
|
||||
results.push({
|
||||
page: p.id,
|
||||
title: p.title,
|
||||
detail: p.description,
|
||||
icon: p.icon,
|
||||
setting: "",
|
||||
rank: title.startsWith(query) ? 0 : 1
|
||||
});
|
||||
for (const keyword of p.keywords || [])
|
||||
if (keyword.toLowerCase().includes(query))
|
||||
results.push({
|
||||
page: p.id,
|
||||
title: keyword,
|
||||
detail: p.title,
|
||||
icon: p.icon,
|
||||
setting: keyword,
|
||||
rank: keyword.toLowerCase().startsWith(query) ? 2 : 3
|
||||
});
|
||||
}
|
||||
return results.sort((a, b) => a.rank - b.rank).slice(0, 40);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,112 @@
|
||||
pragma Singleton
|
||||
import QtQuick
|
||||
import Quickshell
|
||||
|
||||
Singleton {
|
||||
property bool wallpaperPickerOpen: false
|
||||
property var wallpaperScreen: null
|
||||
property var wallpaperWindow: null
|
||||
function openWallpaperPicker() {
|
||||
settingsOpen=false;launcherOpen=false;controlCenterOpen=false;dashboardOpen=false;
|
||||
wallpaperScreen=activeScreen();wallpaperPickerOpen=true;
|
||||
}
|
||||
property var systemPills: []
|
||||
property bool controlCenterOpen: false
|
||||
property var controlCenterScreen: null
|
||||
property var controlCenterWindow: null
|
||||
function openControlCenter() {
|
||||
wallpaperPickerOpen=false;
|
||||
dashboardOpen = false;
|
||||
if (controlCenterOpen)
|
||||
return;
|
||||
launcherOpen = false;
|
||||
settingsOpen = false;
|
||||
controlCenterScreen = activeScreen();
|
||||
controlCenterOpen = true;
|
||||
}
|
||||
function toggleControlCenter() {
|
||||
if (controlCenterOpen)
|
||||
controlCenterOpen = false;
|
||||
else
|
||||
openControlCenter();
|
||||
}
|
||||
// Caelestia-style dashboard; `dashboardTab` is a tab id, not an index.
|
||||
property bool dashboardOpen: false
|
||||
property var dashboardScreen: null
|
||||
property var dashboardWindow: null
|
||||
property string dashboardTab: ""
|
||||
function openDashboard(tab) {
|
||||
wallpaperPickerOpen = false;
|
||||
controlCenterOpen = false;
|
||||
launcherOpen = false;
|
||||
settingsOpen = false;
|
||||
if (tab)
|
||||
dashboardTab = tab;
|
||||
if (!dashboardOpen)
|
||||
dashboardScreen = activeScreen();
|
||||
dashboardOpen = true;
|
||||
}
|
||||
function toggleDashboard(tab) {
|
||||
if (dashboardOpen && (!tab || tab === dashboardTab))
|
||||
dashboardOpen = false;
|
||||
else
|
||||
openDashboard(tab);
|
||||
}
|
||||
property bool launcherOpen: false
|
||||
property var launcherScreen: null
|
||||
function activeScreen() {
|
||||
return ScreenService.active;
|
||||
}
|
||||
function openLauncher() {
|
||||
wallpaperPickerOpen=false;
|
||||
dashboardOpen = false;
|
||||
if (launcherOpen)
|
||||
return;
|
||||
controlCenterOpen = false;
|
||||
settingsOpen = false;
|
||||
launcherScreen = activeScreen();
|
||||
launcherOpen = true;
|
||||
}
|
||||
function toggleLauncher() {
|
||||
if (launcherOpen)
|
||||
launcherOpen = false;
|
||||
else
|
||||
openLauncher();
|
||||
}
|
||||
property var settingsWindow: null
|
||||
property bool settingsOpen: false
|
||||
property string settingsPage: "appearance"
|
||||
// Setting title flashed after a settings search jump; the serial re-triggers repeats.
|
||||
property string settingsHighlight: ""
|
||||
property int settingsHighlightSerial: 0
|
||||
function revealSetting(page, title) {
|
||||
openSettings(page);
|
||||
settingsHighlight = title || "";
|
||||
settingsHighlightSerial++;
|
||||
}
|
||||
property var targetScreen: null
|
||||
property var osdWindow: null
|
||||
// Raised by Lock buttons when the built-in lock screen is enabled.
|
||||
signal lockRequested
|
||||
function requestLock() {
|
||||
lockRequested();
|
||||
}
|
||||
function openSettings(page) {
|
||||
wallpaperPickerOpen=false;
|
||||
dashboardOpen = false;
|
||||
controlCenterOpen = false;
|
||||
launcherOpen = false;
|
||||
const destination = SettingsRegistry.page(page || "appearance");
|
||||
settingsPage = destination ? destination.id : "about";
|
||||
if (!settingsOpen) {
|
||||
targetScreen = activeScreen();
|
||||
}
|
||||
settingsOpen = true;
|
||||
}
|
||||
function toggleSettings() {
|
||||
if (settingsOpen)
|
||||
settingsOpen = false;
|
||||
else
|
||||
openSettings("appearance");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
singleton ModuleRegistry 1.0 ModuleRegistry.qml
|
||||
singleton ShellState 1.0 ShellState.qml
|
||||
singleton ScreenService 1.0 ScreenService.qml
|
||||
singleton SettingsRegistry 1.0 SettingsRegistry.qml
|
||||
singleton PopoutState 1.0 PopoutState.qml
|
||||
singleton DashboardRegistry 1.0 DashboardRegistry.qml
|
||||
singleton BarDrawers 1.0 BarDrawers.qml
|
||||
singleton BarLayout 1.0 BarLayout.qml
|
||||
Reference in new issue
Block a user