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:
mxandClaude Opus 5.5 committed 2026-10-07 22:36:17 +02:00
commit 99e64a7713
433 files changed
+57792

No files matched your search

+156
View File
@@ -0,0 +1,156 @@
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Wayland
import "../components"
import "../services"
import "../core"
import "../theme"
import "DockGeometry.js" as Geometry
// Quickshell selects the concrete layer window at runtime.
// qmllint disable uncreatable-type
PanelWindow {
// qmllint enable uncreatable-type
id: root
screen: ScreenService.resolve(DockModel.options.monitor)
readonly property var options: DockModel.options
readonly property string position: options.position || "bottom"
readonly property bool vertical: position !== "bottom"
readonly property real thickness: (options.iconSize || 48) * (1 + (options.magnification ? options.magnificationStrength : 0)) + 32
readonly property int motionDuration: Math.round(Theme.duration / (options.animationSpeed || 1))
property int hoveredIndex: -1
property bool shown: true
readonly property bool pointerInside: hover.hovered
readonly property bool held: pointerInside || DockState.opened || DockState.draggingId !== ""
readonly property var dockRect: ({
x: screen.x + (vertical ? position === "left" ? options.margin : screen.width - thickness - options.margin : (screen.width - width) / 2),
y: screen.y + (vertical ? (screen.height - height) / 2 : screen.height - thickness - options.margin),
width: vertical ? thickness : width,
height: vertical ? height : thickness
})
readonly property bool overlap: options.visibility === "intelligent" && Geometry.obstructed(dockRect, screen.name, HyprlandService.windows, HyprlandService.visibleWorkspaces)
readonly property bool wantVisible: options.visibility === "always" || held || (options.visibility === "intelligent" && !overlap)
onWantVisibleChanged: updateVisibility()
function updateVisibility() {
if (wantVisible) {
hideTimer.stop();
shown = true;
} else
hideTimer.restart();
}
function dropPin(source, x, y) {
for (const target of DockState.icons) {
if (target.dockWindow !== root || !target.group.pinned || target === source)
continue;
const point = target.mapFromItem(source, x, y);
if (point.x >= 0 && point.y >= 0 && point.x < target.width && point.y < target.height) {
DockModel.reorder(source.group.id, target.group.id);
return;
}
}
}
Component.onCompleted: {
DockState.docks = DockState.docks.concat([root]);
updateVisibility();
}
Component.onDestruction: DockState.docks = DockState.docks.filter(d => d !== root)
anchors {
bottom: !root.vertical
left: root.position === "left"
right: root.position === "right"
}
implicitWidth: vertical ? thickness + options.margin : Math.min(screen.width * 0.9, Math.max(120, grid.implicitWidth + 24))
implicitHeight: vertical ? Math.min(screen.height * 0.85, Math.max(120, grid.implicitHeight + 24)) : thickness + options.margin
color: Theme.transparent
exclusionMode: ExclusionMode.Ignore
WlrLayershell.namespace: "glassMxrph-dock"
WlrLayershell.layer: WlrLayer.Overlay
mask: Region {
item: root.shown ? root.contentItem : sensor
}
HoverHandler {
id: hover
}
Item {
id: sensor
x: root.position === "right" ? root.width - 3 : 0
y: root.vertical ? 0 : root.height - 3
width: root.vertical ? 3 : root.width
height: root.vertical ? root.height : 3
}
Timer {
id: hideTimer
interval: 400
onTriggered: if (!root.wantVisible)
root.shown = false
}
GlassPanel {
id: panel
objectName: "dockSurface"
width: root.vertical ? root.thickness : root.width
height: root.vertical ? root.height : root.thickness
x: root.vertical && root.position === "left" ? root.options.margin : 0
y: 0
opacity: root.shown ? 1 : 0
transform: Translate {
x: root.shown || !root.vertical ? 0 : root.position === "left" ? -root.width : root.width
y: root.shown || root.vertical ? 0 : root.height
Behavior on x {
NumberAnimation {
duration: root.motionDuration
easing.type: Easing.OutCubic
}
}
Behavior on y {
NumberAnimation {
duration: root.motionDuration
easing.type: Easing.OutCubic
}
}
}
Behavior on opacity {
NumberAnimation {
duration: root.motionDuration
}
}
Flickable {
id: view
anchors.fill: parent
anchors.margins: 10
clip: true
contentWidth: root.vertical ? width : grid.implicitWidth
contentHeight: root.vertical ? grid.implicitHeight : height
boundsBehavior: Flickable.StopAtBounds
flickableDirection: root.vertical ? Flickable.VerticalFlick : Flickable.HorizontalFlick
Grid {
id: grid
columns: root.vertical ? 1 : Math.max(1, DockModel.items.length)
spacing: root.options.spacing
x: root.vertical ? (view.width - width) / 2 : 0
y: root.vertical ? 0 : (view.height - height) / 2
Repeater {
model: ScriptModel {
values: DockModel.items
objectProp: "id"
}
DockItem {
dockWindow: root
}
}
}
Text {
anchors.centerIn: parent
visible: DockModel.items.length === 0
text: "Add apps"
color: Theme.textSecondary
font.pixelSize: 13
}
MouseArea {
anchors.fill: parent
enabled: DockModel.items.length === 0
onClicked: ShellState.openSettings("dock")
}
}
}
}
+173
View File
@@ -0,0 +1,173 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
import Quickshell
import Quickshell.Hyprland
import "../components"
import "../services"
import "../theme"
import "../core"
PopupWindow {
id: root
readonly property var group: DockState.group
property bool contentOpen: false
property int selectedIndex: -1
readonly property var rows: {
if (!group)
return [];
if (DockState.chooser)
return chooser.rows;
let rows = [];
if (group.entry)
rows.push({
id: "open",
text: "Open",
kind: "open",
enabled: true
});
rows = rows.concat(chooser.rows);
if (group.entry && group.entry.actions.length) {
rows.push({
id: "actions-separator",
separator: true
});
for (const action of group.entry.actions)
rows.push({
id: "action:" + action.id,
text: action.name,
kind: "action",
action: action,
enabled: true
});
}
rows.push({
id: "pin-separator",
separator: true
});
if (group.pinned)
rows.push({
id: "unpin",
text: "Unpin",
kind: "unpin",
enabled: true
});
else if (group.entry)
rows.push({
id: "pin",
text: "Pin to dock",
kind: "pin",
enabled: true
});
if (group.windows.length) {
rows.push({
id: "close-separator",
separator: true
});
for (const window of group.windows)
rows.push({
id: "close:" + window.address,
text: "Close · " + (window.title || group.name),
kind: "close",
address: window.address,
enabled: true
});
}
return rows;
}
function invoke(index) {
const row = rows[index];
if (!row || row.separator || !row.enabled || !group)
return;
const entry = group.entry;
DockState.close();
if (row.kind === "focus")
Qt.callLater(() => HyprlandService.focusWindow(row.address));
else if (row.kind === "close")
HyprlandService.closeWindow(row.address);
else if (row.kind === "open" || row.kind === "action") {
if (!ApplicationsService.launch(entry, row.action || null))
ShellState.openSettings("dock");
} else if (row.kind === "pin")
DockModel.pin(group.id);
else if (row.kind === "unpin")
DockModel.unpin(group.id);
}
function move(direction) {
const start = selectedIndex < 0 ? (direction > 0 ? -1 : 0) : selectedIndex;
for (let i = 1; i <= rows.length; i++) {
const n = (start + direction * i + rows.length) % rows.length;
if (!rows[n].separator) {
selectedIndex = n;
list.positionViewAtIndex(n, ListView.Contain);
return;
}
}
}
anchor.item: DockState.anchorItem
// Quickshell 0.3.1 exports the enums but omits flags types from metadata.
// qmllint disable missing-type
anchor.edges: DockModel.options.position === "bottom" ? Edges.Top : DockModel.options.position === "left" ? Edges.Right : Edges.Left
anchor.gravity: DockModel.options.position === "bottom" ? Edges.Top : DockModel.options.position === "left" ? Edges.Right : Edges.Left
anchor.adjustment: PopupAdjustment.Flip | PopupAdjustment.Slide
// qmllint enable missing-type
color: Theme.transparent
implicitWidth: 320
implicitHeight: Math.min(screen ? screen.height - 100 : 600, Math.max(70, list.contentHeight + 28))
visible: DockState.opened || surface.visible
Component.onCompleted: DockState.menuWindow = root
Component.onDestruction: DockState.menuWindow = null
Connections {
target: DockState
function onOpenedChanged() {
root.contentOpen = DockState.opened;
if (DockState.opened) {
root.selectedIndex = -1;
surface.forceActiveFocus();
}
}
}
WindowChooser {
id: chooser
group: root.group
}
HyprlandFocusGrab {
windows: [root]
active: DockState.opened
onCleared: DockState.close()
}
GlassMenu {
id: surface
anchors.fill: parent
anchors.margins: 4
opened: root.contentOpen
focus: true
Keys.onEscapePressed: DockState.close()
Keys.onDownPressed: root.move(1)
Keys.onUpPressed: root.move(-1)
Keys.onReturnPressed: root.invoke(root.selectedIndex)
Keys.onEnterPressed: root.invoke(root.selectedIndex)
ListView {
id: list
objectName: "dockMenuList"
anchors.fill: parent
clip: true
model: root.rows
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar {}
delegate: GlassMenuItem {
required property var modelData
required property int index
width: list.width
text: modelData.text || ""
separator: !!modelData.separator
actionEnabled: modelData.enabled === true
selected: root.selectedIndex === index
buttonType: modelData.checked ? QsMenuButtonType.RadioButton : QsMenuButtonType.None
checkState: modelData.checked ? Qt.Checked : Qt.Unchecked
onEntered: root.selectedIndex = index
onInvoked: root.invoke(index)
}
}
}
}
+4
View File
@@ -0,0 +1,4 @@
function intersects(a,b) { return a.x < b.x+b.width && a.x+a.width > b.x && a.y < b.y+b.height && a.y+a.height > b.y; }
function obstructed(rect, monitor, windows, workspaces) {
return windows.some(w => !w.hidden && w.monitor === monitor && (workspaces.includes(w.workspace) || w.active) && (w.fullscreen || intersects(rect,w)));
}
+139
View File
@@ -0,0 +1,139 @@
import QtQuick
import QtQuick.Controls
import "../services"
import "../theme"
Item {
id: root
required property var modelData
required property int index
required property var dockWindow
readonly property var group: DockModel.find(modelData.id) || modelData
readonly property bool vertical: dockWindow.vertical
readonly property var options: DockModel.options
readonly property real influence: Theme.intensity > 0 && options.magnification && dockWindow.hoveredIndex >= 0 && !DockState.draggingId ? Math.max(0, 1 - Math.abs(index - dockWindow.hoveredIndex) / 2.5) : 0
readonly property real magnification: 1 + options.magnificationStrength * influence * Theme.intensity
property bool dragging: false
property point pressedAt
property real offsetX: 0
property real offsetY: 0
width: vertical ? dockWindow.thickness - 20 : options.iconSize + 12 + options.iconSize * influence * 0.2
height: vertical ? options.iconSize + 12 + options.iconSize * influence * 0.2 : dockWindow.thickness - 20
Behavior on width {
NumberAnimation {
duration: root.dockWindow.motionDuration
}
}
Behavior on height {
NumberAnimation {
duration: root.dockWindow.motionDuration
}
}
Component.onCompleted: DockState.icons = DockState.icons.concat([root])
Component.onDestruction: DockState.removeIcon(root)
Item {
id: visual
anchors.centerIn: parent
width: root.options.iconSize
height: width
scale: mouse.pressed && !root.dragging ? 1 - 0.08 * Theme.intensity : root.magnification
transform: Translate {
x: root.offsetX
y: root.offsetY
}
Behavior on scale {
NumberAnimation {
duration: root.dockWindow.motionDuration
easing.type: Easing.OutCubic
}
}
Image {
id: icon
anchors.fill: parent
source: ApplicationsService.icon(root.group.entry)
sourceSize.width: root.options.iconSize * 2
sourceSize.height: root.options.iconSize * 2
fillMode: Image.PreserveAspectFit
}
Rectangle {
anchors.fill: parent
radius: 12
color: Theme.surfaceVariant
visible: icon.source.toString() === "" || icon.status === Image.Error
Text {
anchors.centerIn: parent
text: root.group.name.slice(0, 2).toUpperCase()
color: Theme.text
font.pixelSize: 16
}
}
}
Rectangle {
width: root.group.focused ? 15 : 5
height: 4
radius: 2
x: root.vertical ? (root.options.position === "left" ? 3 : root.width - width - 3) : (root.width - width) / 2
y: root.vertical ? (root.height - height) / 2 : root.height - height - 3
color: root.group.focused ? Theme.accent : Theme.textSecondary
visible: root.options.runningIndicators && root.group.windows.length > 0
Behavior on width {
NumberAnimation {
duration: root.dockWindow.motionDuration
}
}
}
MouseArea {
id: mouse
anchors.fill: parent
hoverEnabled: true
acceptedButtons: Qt.LeftButton | Qt.RightButton
preventStealing: root.group.pinned
onEntered: root.dockWindow.hoveredIndex = root.index
onExited: if (!pressed)
root.dockWindow.hoveredIndex = -1
onPressed: event => {
root.pressedAt = Qt.point(event.x, event.y);
root.dragging = false;
}
onPositionChanged: event => {
if (!pressed || pressedButtons !== Qt.LeftButton || !root.group.pinned)
return;
const dx = event.x - root.pressedAt.x, dy = event.y - root.pressedAt.y;
if (root.dragging || Math.hypot(dx, dy) > 8) {
root.dragging = true;
DockState.draggingId = root.group.id;
root.offsetX = dx;
root.offsetY = dy;
}
}
onReleased: event => {
if (root.dragging)
root.dockWindow.dropPin(root, event.x, event.y);
root.offsetX = 0;
root.offsetY = 0;
DockState.draggingId = "";
}
onCanceled: {
root.offsetX = 0;
root.offsetY = 0;
root.dragging = false;
DockState.draggingId = "";
}
onClicked: event => {
if (root.dragging) {
root.dragging = false;
return;
}
if (event.button === Qt.RightButton)
DockState.open(root.group.id, root, false);
else
DockState.click(root.group.id, root);
}
}
Accessible.role: Accessible.Button
Accessible.name: group.name
Accessible.onPressAction: DockState.click(group.id, root)
ToolTip.visible: options.tooltips && mouse.containsMouse && !DockState.opened && !dragging
ToolTip.delay: 500
ToolTip.text: group.name + (group.windows.length ? " · " + group.windows.length + " window(s)" : group.entry ? "" : " · unavailable")
}
+32
View File
@@ -0,0 +1,32 @@
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));
}
}
+112
View File
@@ -0,0 +1,112 @@
pragma Singleton
import QtQuick
import Quickshell
import Quickshell.Io
import "../services"
import "../core"
Singleton {
id: root
property bool opened: false
property bool chooser: false
property string appId: ""
property Item anchorItem: null
property var docks: []
property var icons: []
property var menuWindow: null
property string draggingId: ""
readonly property var group: DockModel.find(appId)
onGroupChanged: if (!group)
close()
function open(id, item, windowsOnly) {
if (!DockModel.find(id))
return;
TrayService.close();
ShellState.controlCenterOpen = false;
ShellState.launcherOpen = false;
ShellState.settingsOpen = false;
appId = id;
anchorItem = item;
chooser = windowsOnly;
opened = true;
}
function close() {
opened = false;
}
function click(id, item) {
const group = DockModel.find(id);
if (!group)
return;
if (!group.windows.length) {
if (!ApplicationsService.launch(group.entry, null))
ShellState.openSettings("dock");
} else if (group.windows.length === 1)
HyprlandService.focusWindow(group.windows[0].address);
else
open(id, item, true);
}
function removeIcon(icon) {
if (anchorItem === icon)
close();
icons = icons.filter(i => i !== icon);
}
Connections {
target: ShellState
function onControlCenterOpenChanged() {
if (ShellState.controlCenterOpen)
root.close();
}
function onLauncherOpenChanged() {
if (ShellState.launcherOpen)
root.close();
}
function onSettingsOpenChanged() {
if (ShellState.settingsOpen)
root.close();
}
}
Connections {
target: TrayService
function onOpenedChanged() {
if (TrayService.opened)
root.close();
}
}
IpcHandler {
target: "dock"
function status(): string {
return JSON.stringify({
items: DockModel.items.map(i => ({
id: i.id,
pinned: i.pinned,
running: i.windows.length,
focused: i.focused,
matched: !!i.entry
})),
opened: root.opened,
chooser: root.chooser,
docks: root.docks.map(d => ({
screen: d.screen.name,
shown: d.shown,
position: d.position,
overlap: d.overlap,
width: d.width,
height: d.height
})),
error: ApplicationsService.error
});
}
function pin(id: string): bool {
return DockModel.pin(id);
}
function unpin(id: string): bool {
return DockModel.unpin(id);
}
function move(source: string, target: string): bool {
return DockModel.reorder(source, target);
}
function settings(): void {
ShellState.openSettings("dock");
}
}
}
+13
View File
@@ -0,0 +1,13 @@
import QtQuick
QtObject {
property var group: null
readonly property var rows: group ? group.windows.map(w => ({
id: "focus:" + w.address,
text: w.title || group.name,
kind: "focus",
address: w.address,
checked: w.active,
enabled: true
})) : []
}
+6
View File
@@ -0,0 +1,6 @@
singleton DockModel 1.0 DockModel.qml
singleton DockState 1.0 DockState.qml
Dock 1.0 Dock.qml
DockItem 1.0 DockItem.qml
DockContextMenu 1.0 DockContextMenu.qml
WindowChooser 1.0 WindowChooser.qml