Files
mxandClaude Opus 5.5 5217af4f67 Add a notch mode that splits the bar around a pocket-dots style notch
Settings → Notch switches it on. The bar becomes left and right islands
with a notch at the top centre. Super+C, Super+X and a click on the notch
open a three-column panel: dashboard pages on the left (Media,
Performance, Calendar; the wheel switches them), the Control Center tiles
and weather in the middle, and notifications on the right. The
Performance card opens the full "Your computer" view. The launcher drops
out of the notch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-12 16:39:35 +01:00

116 lines
3.6 KiB
QML

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.notchOpen = 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,
// Diagnoses unmatched items: what each window reported.
classes: i.windows.map(w => w.appId + (w.initialClass && w.initialClass !== w.appId ? " (" + w.initialClass + ")" : ""))
})),
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");
}
}
}