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>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-12 16:39:35 +01:00
1 parent 178041edf9
commit 5217af4f67
20 files changed
+919 -14

No files matched your search

+43 -3
View File
@@ -3,6 +3,7 @@ import QtQuick.Shapes
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import "../components" import "../components"
import "../notch"
import "../core" import "../core"
import "../services" import "../services"
import "../theme" import "../theme"
@@ -18,7 +19,14 @@ PanelWindow {
// The window reaches below the bar (input is masked to the bar) so the // The window reaches below the bar (input is masked to the bar) so the
// HyprGlass layer edge is not on the bar's bottom edge, where drawers join. // HyprGlass layer edge is not on the bar's bottom edge, where drawers join.
implicitHeight: BarDrawers.bottom + BarDrawers.overhang implicitHeight: BarDrawers.bottom + BarDrawers.overhang
mask: Region { item: panel } // Notch mode splits the bar into a left island, the centre notch and a
// right island; only those take input.
readonly property bool notch: ShellState.notchMode
mask: Region {
item: root.notch ? leftIsland : panel
Region { item: root.notch ? notchPill : null; intersection: Intersection.Combine }
Region { item: root.notch ? rightIsland : null; intersection: Intersection.Combine }
}
color: Theme.transparent color: Theme.transparent
// Reserve the bar itself (margin + height), not the overhang below it, so // Reserve the bar itself (margin + height), not the overhang below it, so
// windows tile beneath the bar instead of under it. // windows tile beneath the bar instead of under it.
@@ -29,18 +37,21 @@ PanelWindow {
Component.onDestruction: TrayService.unregisterBar(root) Component.onDestruction: TrayService.unregisterBar(root)
GlassPanel { GlassPanel {
id: panel id: panel
visible: !root.notch
x: root.outerMargin; y: root.outerMargin x: root.outerMargin; y: root.outerMargin
width: root.width - 2 * root.outerMargin width: root.width - 2 * root.outerMargin
height: BarDrawers.height height: BarDrawers.height
radius: BarDrawers.radius radius: BarDrawers.radius
border.width: 0 border.width: 0
ModuleRow { position: "left"; barScreen: root.screen; anchors.left: parent.left; anchors.leftMargin: 6; anchors.verticalCenter: parent.verticalCenter } // In notch mode the side rows move into their islands; the notch replaces the centre.
ModuleRow { id: leftRow; parent: root.notch ? leftIsland : panel; position: "left"; barScreen: root.screen; anchors.left: parent.left; anchors.leftMargin: 6; anchors.verticalCenter: parent.verticalCenter }
ModuleRow { position: "center"; barScreen: root.screen; anchors.centerIn: parent } ModuleRow { position: "center"; barScreen: root.screen; anchors.centerIn: parent }
ModuleRow { position: "right"; barScreen: root.screen; anchors.right: parent.right; anchors.rightMargin: 6; anchors.verticalCenter: parent.verticalCenter } ModuleRow { id: rightRow; parent: root.notch ? rightIsland : panel; position: "right"; barScreen: root.screen; anchors.right: parent.right; anchors.rightMargin: 6; anchors.verticalCenter: parent.verticalCenter }
} }
// Outline with openings where drawers hang from the bar. // Outline with openings where drawers hang from the bar.
Shape { Shape {
id: outline id: outline
visible: !root.notch
x: panel.x x: panel.x
y: panel.y y: panel.y
width: panel.width width: panel.width
@@ -63,4 +74,33 @@ PanelWindow {
} }
} }
} }
// Notch mode -------------------------------------------------------------
GlassPanel {
id: leftIsland
visible: root.notch
x: root.outerMargin
y: root.outerMargin
width: leftRow.implicitWidth + 12
height: BarDrawers.height
radius: BarDrawers.radius
}
GlassPanel {
id: rightIsland
visible: root.notch
x: root.width - root.outerMargin - width
y: root.outerMargin
width: rightRow.implicitWidth + 12
height: BarDrawers.height
radius: BarDrawers.radius
}
NotchPill {
id: notchPill
barScreen: root.screen
x: Math.round((root.width - width) / 2)
y: 0
width: implicitWidth
height: implicitHeight
// The open notch window draws over this spot on its own screen.
visible: root.notch && !(ShellState.notchWindow && ShellState.notchWindow.visible && ShellState.notchWindow.screen === root.screen) && !(ShellState.launcherOpen && ScreenService.current(ShellState.launcherScreen) === root.screen)
}
} }
+4
View File
@@ -262,6 +262,10 @@
}, },
"effectEnabled": true "effectEnabled": true
}, },
"notch": {
"enabled": false,
"mediaFirst": true
},
"dashboard": { "dashboard": {
"enabled": true, "enabled": true,
"position": "top-center", "position": "top-center",
+11
View File
@@ -70,6 +70,17 @@ Singleton {
icon: "󰕮", icon: "󰕮",
keywords: ["Bar height", "Margin", "Modules", "Show date", "24-hour time", "Show seconds", "Workspace count", "Workspace style", "Pacman", "Roman numerals", "Clock"] keywords: ["Bar height", "Margin", "Modules", "Show date", "24-hour time", "Show seconds", "Workspace count", "Workspace style", "Pacman", "Roman numerals", "Clock"]
}, },
{
id: "notch",
title: "Notch",
command: "notch",
description: "Notch mode: side islands and a pocket-dots style notch instead of the bar",
phase: 9,
available: true,
group: "shell",
icon: "󰹑",
keywords: ["Notch", "Notch mode", "Open on Media while audio plays", "Pocket-dots", "Island"]
},
{ {
id: "tray", id: "tray",
title: "Bar / Tray", title: "Bar / Tray",
+44 -1
View File
@@ -1,13 +1,14 @@
pragma Singleton pragma Singleton
import QtQuick import QtQuick
import Quickshell import Quickshell
import "../services"
Singleton { Singleton {
property bool wallpaperPickerOpen: false property bool wallpaperPickerOpen: false
property var wallpaperScreen: null property var wallpaperScreen: null
property var wallpaperWindow: null property var wallpaperWindow: null
function openWallpaperPicker() { function openWallpaperPicker() {
settingsOpen=false;launcherOpen=false;controlCenterOpen=false;dashboardOpen=false;overviewOpen=false; settingsOpen=false;launcherOpen=false;controlCenterOpen=false;dashboardOpen=false;overviewOpen=false;notchOpen=false;
wallpaperScreen=activeScreen();wallpaperPickerOpen=true; wallpaperScreen=activeScreen();wallpaperPickerOpen=true;
} }
property var systemPills: [] property var systemPills: []
@@ -15,6 +16,8 @@ Singleton {
property var controlCenterScreen: null property var controlCenterScreen: null
property var controlCenterWindow: null property var controlCenterWindow: null
function openControlCenter() { function openControlCenter() {
if (notchMode)
return openNotch();
wallpaperPickerOpen=false; wallpaperPickerOpen=false;
overviewOpen = false; overviewOpen = false;
dashboardOpen = false; dashboardOpen = false;
@@ -26,6 +29,8 @@ Singleton {
controlCenterOpen = true; controlCenterOpen = true;
} }
function toggleControlCenter() { function toggleControlCenter() {
if (notchMode)
return toggleNotch();
if (controlCenterOpen) if (controlCenterOpen)
controlCenterOpen = false; controlCenterOpen = false;
else else
@@ -37,6 +42,8 @@ Singleton {
property var dashboardWindow: null property var dashboardWindow: null
property string dashboardTab: "" property string dashboardTab: ""
function openDashboard(tab) { function openDashboard(tab) {
if (notchMode)
return openNotch();
wallpaperPickerOpen = false; wallpaperPickerOpen = false;
overviewOpen = false; overviewOpen = false;
controlCenterOpen = false; controlCenterOpen = false;
@@ -49,17 +56,51 @@ Singleton {
dashboardOpen = true; dashboardOpen = true;
} }
function toggleDashboard(tab) { function toggleDashboard(tab) {
if (notchMode)
return toggleNotch();
if (dashboardOpen && (!tab || tab === dashboardTab)) if (dashboardOpen && (!tab || tab === dashboardTab))
dashboardOpen = false; dashboardOpen = false;
else else
openDashboard(tab); openDashboard(tab);
} }
// Notch mode (pocket-dots style): the bar splits into side islands and a
// centre notch; the Control Center and Dashboard keys open the notch instead.
readonly property bool notchMode: ConfigService.ready && !!ConfigService.data.notch && ConfigService.data.notch.enabled
property bool notchOpen: false
// Collapsed notch body width (ears excluded): clock alone, or art + clock + cava.
readonly property real notchPillWidth: MediaService.playing ? 236 : 128
property var notchScreen: null
property var notchWindow: null
// "main" is the three-column panel; "computer" is the full Performance view.
property string notchView: "main"
function openNotch() {
wallpaperPickerOpen = false;
overviewOpen = false;
controlCenterOpen = false;
dashboardOpen = false;
launcherOpen = false;
settingsOpen = false;
if (!notchOpen) {
notchScreen = activeScreen();
notchView = "main";
}
notchOpen = true;
}
function toggleNotch() {
if (notchOpen)
notchOpen = false;
else
openNotch();
}
onNotchModeChanged: if (!notchMode)
notchOpen = false
// Workspace overview (SUPER+Tab): a drawer of live workspace thumbnails. // Workspace overview (SUPER+Tab): a drawer of live workspace thumbnails.
property bool overviewOpen: false property bool overviewOpen: false
property var overviewScreen: null property var overviewScreen: null
property var overviewWindow: null property var overviewWindow: null
function openOverview() { function openOverview() {
wallpaperPickerOpen = false; wallpaperPickerOpen = false;
notchOpen = false;
controlCenterOpen = false; controlCenterOpen = false;
dashboardOpen = false; dashboardOpen = false;
launcherOpen = false; launcherOpen = false;
@@ -85,6 +126,7 @@ Singleton {
} }
function openLauncher(mode) { function openLauncher(mode) {
wallpaperPickerOpen=false; wallpaperPickerOpen=false;
notchOpen = false;
overviewOpen = false; overviewOpen = false;
dashboardOpen = false; dashboardOpen = false;
launcherMode = mode === "clipboard" || mode === "emoji" ? mode : "apps"; launcherMode = mode === "clipboard" || mode === "emoji" ? mode : "apps";
@@ -130,6 +172,7 @@ Singleton {
} }
function openSettings(page) { function openSettings(page) {
wallpaperPickerOpen=false; wallpaperPickerOpen=false;
notchOpen = false;
overviewOpen = false; overviewOpen = false;
dashboardOpen = false; dashboardOpen = false;
controlCenterOpen = false; controlCenterOpen = false;
+1
View File
@@ -23,6 +23,7 @@ Singleton {
return; return;
TrayService.close(); TrayService.close();
ShellState.controlCenterOpen = false; ShellState.controlCenterOpen = false;
ShellState.notchOpen = false;
ShellState.launcherOpen = false; ShellState.launcherOpen = false;
ShellState.settingsOpen = false; ShellState.settingsOpen = false;
appId = id; appId = id;
+44 -7
View File
@@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
import QtQuick import QtQuick
import QtQuick.Controls import QtQuick.Controls
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Shapes
import Quickshell import Quickshell
import Quickshell.Wayland import Quickshell.Wayland
import "../components" import "../components"
@@ -76,7 +77,11 @@ PanelWindow {
// A hovered mode pill names itself in the empty search bar. // A hovered mode pill names itself in the empty search bar.
property string pillHover: "" property string pillHover: ""
readonly property int barHeight: 60 readonly property int barHeight: 60
readonly property real maxBodyHeight: Math.min(460, root.height * 0.78 - barHeight - (root.height * 0.22)) // Notch mode: the launcher drops out of the notch at the top edge. The
// panel's top corners sit above the screen and concave ears join it there.
readonly property bool notch: ShellState.notchMode
readonly property real notchInset: notch ? panel.radius : 0
readonly property real maxBodyHeight: Math.min(460, root.height * 0.78 - barHeight - (notch ? 0 : root.height * 0.22))
// Clipboard mode shows the latest five rows; the rest scroll. // Clipboard mode shows the latest five rows; the rest scroll.
readonly property real clipboardRows: 5 * 48 - 2 readonly property real clipboardRows: 5 * 48 - 2
// Emoji mode shows six rows of the grid; the rest scroll. // Emoji mode shows six rows of the grid; the rest scroll.
@@ -193,7 +198,7 @@ PanelWindow {
id: pills id: pills
objectName: "launcherPills" objectName: "launcherPills"
x: panel.x + panel.width + 10 x: panel.x + panel.width + 10
y: panel.y + (root.barHeight - root.pillSize) / 2 y: panel.y + root.notchInset + (root.barHeight - root.pillSize) / 2
spacing: 10 spacing: 10
opacity: panel.opacity opacity: panel.opacity
scale: panel.scale scale: panel.scale
@@ -256,16 +261,47 @@ PanelWindow {
} }
} }
} }
// Notch ears: concave fillets joining the panel to the screen's top edge.
Repeater {
model: root.notch ? [0, 1] : []
Shape {
id: earShape
required property int modelData
readonly property real e: BarDrawers.ear
x: modelData === 0 ? panel.x - e : panel.x + panel.width
y: 0
width: e
height: e
opacity: panel.opacity
preferredRendererType: Shape.CurveRenderer
ShapePath {
fillColor: panel.color
strokeColor: "transparent"
strokeWidth: 0
PathSvg {
path: earShape.modelData === 0 ? `M 0 0 L ${earShape.e} 0 L ${earShape.e} ${earShape.e} A ${earShape.e} ${earShape.e} 0 0 0 0 0 Z` : `M 0 0 L ${earShape.e} 0 A ${earShape.e} ${earShape.e} 0 0 0 0 ${earShape.e} Z`
}
}
ShapePath {
fillColor: "transparent"
strokeColor: panel.border.color
strokeWidth: 1
PathSvg {
path: earShape.modelData === 0 ? `M 0 0.5 A ${earShape.e} ${earShape.e} 0 0 1 ${earShape.e - 0.5} ${earShape.e}` : `M 0.5 ${earShape.e} A ${earShape.e} ${earShape.e} 0 0 1 ${earShape.e} 0.5`
}
}
}
}
GlassPanel { GlassPanel {
id: panel id: panel
objectName: "launcherSurface" objectName: "launcherSurface"
x: Math.round((root.width - width) / 2) x: Math.round((root.width - width) / 2)
y: Math.round(root.height * 0.22) y: root.notch ? -root.notchInset : Math.round(root.height * 0.22)
width: ShellState.launcherOpen ? root.targetWidth : Math.min(320, root.targetWidth) width: ShellState.launcherOpen ? root.targetWidth : root.notch ? ShellState.notchPillWidth : Math.min(320, root.targetWidth)
height: root.barHeight + root.bodyHeight height: root.barHeight + root.bodyHeight + root.notchInset
radius: Math.min(Theme.radius + 6, root.barHeight / 2) radius: Math.min(Theme.radius + 6, root.barHeight / 2)
opacity: ShellState.launcherOpen ? 1 : 0 opacity: ShellState.launcherOpen ? 1 : 0
scale: ShellState.launcherOpen ? 1 : 1 - 0.04 * Theme.intensity scale: ShellState.launcherOpen || root.notch ? 1 : 1 - 0.04 * Theme.intensity
clip: true clip: true
Behavior on width { Behavior on width {
NumberAnimation { NumberAnimation {
@@ -301,6 +337,7 @@ PanelWindow {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.top: parent.top anchors.top: parent.top
anchors.topMargin: root.notchInset
height: root.barHeight height: root.barHeight
anchors.leftMargin: 12 anchors.leftMargin: 12
anchors.rightMargin: 18 anchors.rightMargin: 18
@@ -401,7 +438,7 @@ PanelWindow {
anchors.right: parent.right anchors.right: parent.right
anchors.top: bar.bottom anchors.top: bar.bottom
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
visible: root.bodyHeight > 0 || panel.height > root.barHeight + 1 visible: root.bodyHeight > 0 || panel.height > root.barHeight + root.notchInset + 1
Rectangle { Rectangle {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
+1
View File
@@ -74,6 +74,7 @@ Singleton {
previewing = false; previewing = false;
ShellState.settingsOpen = false; ShellState.settingsOpen = false;
ShellState.controlCenterOpen = false; ShellState.controlCenterOpen = false;
ShellState.notchOpen = false;
ShellState.launcherOpen = false; ShellState.launcherOpen = false;
primary = mainScreen(); primary = mainScreen();
status = ""; status = "";
+592
View File
@@ -0,0 +1,592 @@
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Controls
import Quickshell
import Quickshell.Io
import Quickshell.Wayland
import "../components"
import "../controlcenter"
import "../controlcenter/GridLogic.js" as Grid
import "../core"
import "../dashboard"
import "../media"
import "../services"
import "../theme"
import "../widgets/faces" as Faces
// Notch mode's open panel (pocket-dots style). It grows out of the collapsed
// notch at the top edge into three columns: a dashboard pager on the left
// (Media, Performance, Calendar; the wheel moves between them), the Control
// Center tiles and weather in the middle, and notifications on the right.
// Clicking Performance swaps in the full "Your computer" view.
// The layer is sized to the shape so HyprGlass follows its outline.
// qmllint disable uncreatable-type
PanelWindow {
// qmllint enable uncreatable-type
id: root
screen: ScreenService.current(ShellState.notchScreen)
readonly property real screenWidth: screen ? screen.width : 1920
readonly property real screenHeight: screen ? screen.height : 1080
readonly property var options: ConfigService.ready ? ConfigService.data.notch : null
readonly property bool computer: ShellState.notchView === "computer"
readonly property real ear: BarDrawers.ear
readonly property real band: BarDrawers.bottom
readonly property int pad: 22
readonly property int sideWidth: 330
readonly property int middleWidth: 440
readonly property int columnGap: 44
// Open size of each view, then the morph between the pill and that size.
readonly property real mainWidth: 2 * sideWidth + middleWidth + 2 * columnGap + 2 * pad
readonly property real mainHeight: Math.max(440, middle.contentHeight + band + pad)
readonly property Item computerItem: computerLoader.item as Item
readonly property real computerWidth: (computerItem ? computerItem.implicitWidth : 800) + 2 * pad
readonly property real computerHeight: band + 44 + (computerItem ? computerItem.implicitHeight : 400) + pad
readonly property real openWidth: Math.min(screenWidth - 2 * (BarDrawers.margin + ear) - 40, computer ? computerWidth : mainWidth)
readonly property real openHeight: Math.min(screenHeight - 40, computer ? computerHeight : mainHeight)
property real progress: ShellState.notchOpen ? 1 : 0
Behavior on progress {
NumberAnimation {
id: morph
duration: ShellState.notchOpen ? Theme.duration * 2 : Theme.duration * 1.3
easing.type: Easing.BezierSpline
easing.bezierCurve: ShellState.notchOpen ? [0.2, 0, 0, 1, 1, 1] : [0.3, 0, 0.8, 0.15, 1, 1]
}
}
readonly property bool settled: ShellState.notchOpen && !morph.running
// Width leads the height a little, like a notch unfolding.
readonly property real wp: Math.min(1, progress * 1.15)
property real targetWidth: openWidth
property real targetHeight: openHeight
Behavior on targetWidth {
enabled: root.settled
NumberAnimation {
duration: Theme.duration * 1.4
easing.type: Easing.BezierSpline
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
}
}
Behavior on targetHeight {
enabled: root.settled
NumberAnimation {
duration: Theme.duration * 1.4
easing.type: Easing.BezierSpline
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
}
}
readonly property real bodyWidth: ShellState.notchPillWidth + (targetWidth - ShellState.notchPillWidth) * wp
readonly property real bodyHeight: band + (targetHeight - band) * progress
// Content fades in once the shape has mostly opened, and out first.
readonly property real contentOpacity: Math.max(0, Math.min(1, (progress - 0.55) / 0.4))
anchors.top: true
implicitWidth: Math.round(bodyWidth + 2 * ear)
implicitHeight: Math.max(1, Math.round(bodyHeight))
visible: ShellState.notchOpen || progress > 0.001
color: Theme.transparent
exclusionMode: ExclusionMode.Ignore
WlrLayershell.layer: WlrLayer.Overlay
// Shares the dashboard's HyprGlass namespace (already whitelisted).
WlrLayershell.namespace: "glassMxrph-dashboard"
WlrLayershell.keyboardFocus: ShellState.notchOpen ? WlrKeyboardFocus.Exclusive : WlrKeyboardFocus.None
Component.onCompleted: ShellState.notchWindow = root
Component.onDestruction: ShellState.notchWindow = null
// Opening with audio playing always lands on Media.
Connections {
target: ShellState
function onNotchOpenChanged() {
if (ShellState.notchOpen) {
if (MediaService.playing && (!root.options || root.options.mediaFirst))
pager.page = 0;
body.forceActiveFocus();
}
}
}
// Exclusive focus routes outside clicks here (see ControlCenter).
MouseArea {
objectName: "notchOutside"
x: -20000
y: -20000
width: 40000
height: 40000
onPressed: ShellState.notchOpen = false
}
DrawerShape {
bodyWidth: root.bodyWidth
bodyHeight: root.bodyHeight
ear: root.ear
radius: Math.min(Theme.radius + 8, root.bodyHeight / 2)
}
Item {
id: body
objectName: "notchSurface"
x: root.ear
width: root.bodyWidth
height: root.bodyHeight
clip: true
focus: ShellState.notchOpen
Keys.onEscapePressed: {
if (root.computer)
ShellState.notchView = "main";
else
ShellState.notchOpen = false;
}
Keys.onUpPressed: pager.go(pager.page - 1)
Keys.onDownPressed: pager.go(pager.page + 1)
MouseArea {
anchors.fill: parent
} // Inside clicks must not dismiss.
// The clock stays put in the band while the notch opens around it.
SystemClock {
id: clock
precision: SystemClock.Minutes
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
y: (root.band - height) / 2
spacing: 8
Text {
text: Qt.formatDateTime(clock.date, ConfigService.ready && !ConfigService.data.bar.clock.use24Hour ? "h:mm" : "HH:mm")
color: Theme.text
font.pixelSize: 14
font.weight: Font.DemiBold
font.features: {
"tnum": 1
}
}
Text {
opacity: root.contentOpacity
text: "· " + Qt.formatDateTime(clock.date, "ddd d MMMM")
color: Theme.textSecondary
font.pixelSize: 14
}
}
// Main view ----------------------------------------------------------
Item {
id: main
x: (root.bodyWidth - root.mainWidth) / 2 + root.pad
y: root.band
width: root.mainWidth - 2 * root.pad
height: root.targetHeight - root.band - root.pad
visible: opacity > 0
opacity: root.computer ? 0 : root.contentOpacity
Behavior on opacity {
enabled: root.settled
NumberAnimation {
duration: Theme.duration
}
}
// Left: dashboard pager.
Item {
id: pager
objectName: "notchPager"
width: root.sideWidth
height: parent.height
clip: true
property int page: 0
readonly property int count: 3
function go(i) {
page = Math.max(0, Math.min(count - 1, i));
}
property real wheelAccum: 0
Timer {
id: wheelLock
interval: 320
}
Column {
y: -pager.page * pager.height
Behavior on y {
NumberAnimation {
duration: Theme.duration * 1.6
easing.type: Easing.BezierSpline
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
}
}
// Media
Item {
width: pager.width
height: pager.height
MediaCard {
anchors.centerIn: parent
width: parent.width - 20
compact: true
color: Theme.transparent
border.width: 0
}
}
// Performance: click for the full view.
Item {
id: perf
width: pager.width
height: pager.height
readonly property var disk: (MetricsService.snapshot.storage || []).find(s => s.available) || ({})
Demand {
service: MetricsService
active: ShellState.notchOpen && pager.page === 1
}
Rectangle {
anchors.centerIn: parent
width: parent.width - 20
height: perfColumn.implicitHeight + 36
radius: Math.max(12, Theme.radius * 0.75)
color: perfArea.containsMouse ? Theme.hover : Theme.surfaceVariant
border.width: 1
border.color: Theme.hairline
Behavior on color {
ColorAnimation {
duration: Theme.duration / 2
}
}
Column {
id: perfColumn
anchors.centerIn: parent
width: parent.width - 36
spacing: 18
Item {
width: parent.width
height: 22
Text {
text: "Your computer"
color: Theme.text
font.pixelSize: 15
font.weight: Font.DemiBold
}
Text {
anchors.right: parent.right
text: Icons.available ? "󰅂" : "›"
font.family: Icons.available ? Icons.family : ""
color: Theme.textSecondary
font.pixelSize: 18
}
}
Row {
anchors.horizontalCenter: parent.horizontalCenter
spacing: 14
Gauge {
size: 76
value: MetricsService.cpu.percent
caption: "CPU"
}
Gauge {
size: 76
value: MetricsService.ram.percent
caption: "Memory"
}
Gauge {
size: 76
value: perf.disk.percent
caption: "Disk"
}
}
Text {
width: parent.width
horizontalAlignment: Text.AlignHCenter
readonly property var gpu: MetricsService.gpu || ({})
text: Number.isFinite(gpu.percent) ? "GPU " + Math.round(gpu.percent) + "%" + (Number.isFinite(gpu.temperature) ? " · " + Math.round(gpu.temperature) + " °C" : "") : "Click for details"
color: Theme.textSecondary
font.pixelSize: 12
}
}
MouseArea {
id: perfArea
objectName: "notchComputer"
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: ShellState.notchView = "computer"
}
}
}
// Calendar
Item {
width: pager.width
height: pager.height
Faces.CalendarFace {
anchors.centerIn: parent
width: parent.width - 20
height: Math.min(parent.height, 300)
}
}
}
// Wheel moves one page per notch; touchpads are rate-limited.
MouseArea {
anchors.fill: parent
acceptedButtons: Qt.NoButton
onWheel: wheel => {
pager.wheelAccum += wheel.angleDelta.y;
if (Math.abs(pager.wheelAccum) < 120 || wheelLock.running)
return;
pager.go(pager.page + (pager.wheelAccum < 0 ? 1 : -1));
pager.wheelAccum = 0;
wheelLock.restart();
}
}
Column {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
spacing: 8
Repeater {
model: pager.count
Rectangle {
required property int index
width: 6
height: pager.page === index ? 20 : 6
radius: 3
color: pager.page === index ? Theme.accent : Qt.alpha(Theme.text, 0.25)
Behavior on height {
NumberAnimation {
duration: Theme.duration
easing.type: Easing.OutCubic
}
}
MouseArea {
anchors.fill: parent
anchors.margins: -4
cursorShape: Qt.PointingHandCursor
onClicked: pager.go(parent.index)
}
}
}
}
}
Rectangle {
x: root.sideWidth + root.columnGap / 2
width: 1
height: parent.height
color: Theme.hairline
}
// Middle: Control Center tiles (minus Now Playing, which is on the
// left) packed in their saved order, then the weather.
Flickable {
id: middle
x: root.sideWidth + root.columnGap
width: root.middleWidth
height: parent.height
contentWidth: width
contentHeight: middleColumn.implicitHeight
clip: true
boundsBehavior: Flickable.StopAtBounds
ScrollBar.vertical: ScrollBar {
policy: ScrollBar.AsNeeded
}
readonly property int gap: 10
readonly property int cellHeight: 68
readonly property real cellWidth: (width - 3 * gap) / Grid.COLS
readonly property var tiles: (ConfigService.ready ? ConfigService.data.controlCenter.modules : []).filter(m => m.enabled && m.id !== "media" && !!ControlRegistry.entry(m.id) && !ControlRegistry.entry(m.id).section).slice().sort((a, b) => ((Number.isInteger(a.y) ? a.y : 99) - (Number.isInteger(b.y) ? b.y : 99)) || ((Number.isInteger(a.x) ? a.x : 0) - (Number.isInteger(b.x) ? b.x : 0)))
readonly property var plan: Grid.layout(tiles.map(m => {
const size = ControlRegistry.size(m);
return {
id: m.id,
w: size.w,
h: size.h
};
}))
property var extras: ({})
function setExtra(id, value) {
if ((extras[id] || 0) === value)
return;
const next = Object.assign({}, extras);
next[id] = value;
extras = next;
}
readonly property var geometry: Grid.geometry(plan, cellWidth, cellHeight, gap, extras)
readonly property var weatherOptions: {
const items = ConfigService.ready ? ConfigService.data.desktopWidgets.items : [];
const w = items.find(i => i.type === "weather");
return w && w.options ? w.options : {};
}
Column {
id: middleColumn
width: middle.width
spacing: 14
Item {
id: tileGrid
width: parent.width
height: middle.geometry.height
Repeater {
model: ScriptModel {
values: middle.tiles.map(m => m.id)
}
Item {
id: slot
required property string modelData
readonly property var cell: middle.plan.items.find(i => i.id === modelData) || null
readonly property var rect: middle.geometry.tiles[modelData] || null
readonly property real extra: loader.item ? loader.item.extraHeight : 0
objectName: "notchTile-" + modelData
visible: !!rect
x: rect ? rect.x : 0
y: rect ? rect.y : 0
width: rect ? rect.w : 0
height: rect ? rect.h : 0
onExtraChanged: middle.setExtra(modelData, extra)
Behavior on y {
enabled: root.settled
NumberAnimation {
duration: Theme.duration
easing.type: Easing.OutCubic
}
}
Loader {
id: loader
anchors.fill: parent
active: ShellState.notchOpen
source: ControlRegistry.entry(slot.modelData).source
}
Binding {
target: loader.item
when: !!loader.item
property: "moduleId"
value: slot.modelData
}
Binding {
target: loader.item
when: !!loader.item && !!slot.cell
property: "cols"
value: slot.cell ? slot.cell.w : 1
}
Binding {
target: loader.item
when: !!loader.item && !!slot.cell
property: "rows"
value: slot.cell ? slot.cell.h : 1
}
Binding {
target: loader.item
when: !!loader.item && !!slot.cell
property: "baseHeight"
value: slot.cell ? slot.cell.h * middle.cellHeight + (slot.cell.h - 1) * middle.gap : 0
}
}
}
}
Rectangle {
width: parent.width
height: 92
radius: Math.min(30, height / 2)
color: Theme.fill
border.width: 1
border.color: Theme.hairline
Faces.WeatherFace {
anchors.fill: parent
options: middle.weatherOptions
visible: ShellState.notchOpen
}
}
}
}
Rectangle {
x: root.sideWidth + root.columnGap + root.middleWidth + root.columnGap / 2
width: 1
height: parent.height
color: Theme.hairline
}
// Right: notifications.
Flickable {
x: root.sideWidth + 2 * root.columnGap + root.middleWidth
width: root.sideWidth
height: parent.height
contentWidth: width
contentHeight: notifications.implicitHeight
clip: true
boundsBehavior: Flickable.StopAtBounds
Loader {
id: notifications
width: parent.width
active: ShellState.notchOpen
source: ControlRegistry.entry("notifications").source
}
}
}
// "Your computer": the dashboard's Performance tab -------------------
Item {
id: computerView
x: root.pad
y: root.band
width: root.bodyWidth - 2 * root.pad
height: root.bodyHeight - root.band - root.pad
visible: opacity > 0
opacity: root.computer ? root.contentOpacity : 0
Behavior on opacity {
enabled: root.settled
NumberAnimation {
duration: Theme.duration
}
}
Rectangle {
id: back
objectName: "notchBack"
width: backLabel.implicitWidth + 28
height: 30
radius: 15
color: backArea.containsMouse ? Theme.hover : Theme.fill
border.width: 1
border.color: Theme.hairline
Text {
id: backLabel
anchors.centerIn: parent
text: (Icons.available ? "󰅁 " : "‹ ") + "Your computer"
color: Theme.text
font.pixelSize: 13
font.weight: Font.DemiBold
}
MouseArea {
id: backArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: ShellState.notchView = "main"
}
}
Loader {
id: computerLoader
y: 44
anchors.horizontalCenter: parent.horizontalCenter
active: ShellState.notchOpen && root.computer
source: DashboardRegistry.entry("performance").source
onLoaded: item.current = Qt.binding(() => ShellState.notchOpen && root.computer)
}
}
}
IpcHandler {
target: "notch"
function toggle(): void {
ShellState.toggleNotch();
}
function open(): void {
ShellState.openNotch();
}
function close(): void {
ShellState.notchOpen = false;
}
function page(index: int): void {
pager.go(index);
}
function view(name: string): void {
ShellState.notchView = name === "computer" ? "computer" : "main";
}
function status(): string {
return JSON.stringify({
mode: ShellState.notchMode,
open: ShellState.notchOpen,
visible: root.visible,
view: ShellState.notchView,
page: pager.page,
screen: root.screen ? root.screen.name : "",
width: root.implicitWidth,
height: root.implicitHeight
});
}
}
}
+111
View File
@@ -0,0 +1,111 @@
pragma ComponentBehavior: Bound
import QtQuick
import Quickshell
import Quickshell.Widgets
import "../components"
import "../core"
import "../services"
import "../theme"
// The collapsed notch: a glass island hanging from the screen's top edge with
// concave ears, showing the time, plus cover art and a small visualizer while
// audio plays. Clicking it opens the notch panel.
Item {
id: root
property var barScreen
readonly property real bodyWidth: ShellState.notchPillWidth
readonly property bool playing: MediaService.playing
implicitWidth: bodyWidth + 2 * BarDrawers.ear
implicitHeight: BarDrawers.bottom
Behavior on implicitWidth {
NumberAnimation {
duration: Theme.duration * 1.6
easing.type: Easing.BezierSpline
easing.bezierCurve: [0.2, 0, 0, 1, 1, 1]
}
}
SystemClock {
id: clock
precision: SystemClock.Minutes
}
Demand {
service: CavaService
counter: "widgetConsumers"
active: root.visible && root.playing
}
DrawerShape {
bodyWidth: root.width - 2 * BarDrawers.ear
bodyHeight: root.height
ear: BarDrawers.ear
radius: Math.min(Theme.radius, root.height / 2)
}
Row {
id: content
anchors.centerIn: parent
spacing: 10
ClippingRectangle {
visible: root.playing
anchors.verticalCenter: parent.verticalCenter
width: 22
height: 22
radius: 6
color: Theme.fill
Image {
anchors.fill: parent
source: MediaService.artwork
sourceSize: Qt.size(44, 44)
fillMode: Image.PreserveAspectCrop
asynchronous: true
}
}
Text {
anchors.verticalCenter: parent.verticalCenter
text: Qt.formatDateTime(clock.date, ConfigService.ready && !ConfigService.data.bar.clock.use24Hour ? "h:mm" : "HH:mm")
color: Theme.text
font.pixelSize: 14
font.weight: Font.DemiBold
font.features: {
"tnum": 1
}
}
Row {
visible: root.playing
anchors.verticalCenter: parent.verticalCenter
height: 16
spacing: 2
Repeater {
model: 8
Rectangle {
required property int index
// Every third Cava band, so the eight span the spectrum.
readonly property real level: CavaService.bars[index * 3] || 0
width: 3
height: Math.max(3, 16 * level)
y: 16 - height
radius: 1.5
color: Theme.accent
}
}
}
}
MouseArea {
anchors.fill: parent
anchors.leftMargin: BarDrawers.ear
anchors.rightMargin: BarDrawers.ear
cursorShape: Qt.PointingHandCursor
acceptedButtons: Qt.LeftButton | Qt.RightButton
onClicked: mouse => {
if (mouse.button === Qt.RightButton)
MediaService.toggle();
else
ShellState.toggleNotch();
}
// Wheel changes the volume, as on pocket-dots.
onWheel: wheel => {
const audio = AudioService.sink ? AudioService.sink.audio : null;
const step = ConfigService.ready ? ConfigService.data.osd.step : 5;
if (audio && wheel.angleDelta.y !== 0)
AudioService.volume(false, audio.volume + (wheel.angleDelta.y > 0 ? 1 : -1) * step / 100);
}
}
}
@@ -21,7 +21,7 @@ PanelWindow {
// The OSD capsule takes this spot while it is up; banners wait behind it. // The OSD capsule takes this spot while it is up; banners wait behind it.
readonly property var osd: ShellState.osdWindow readonly property var osd: ShellState.osdWindow
readonly property bool yielding: !!osd && osd.shown && osd.options.position === options.position readonly property bool yielding: !!osd && osd.shown && osd.options.position === options.position
readonly property bool shown: NotificationService.active && items.length > 0 && !yielding && !ShellState.controlCenterOpen readonly property bool shown: NotificationService.active && items.length > 0 && !yielding && !ShellState.controlCenterOpen && !ShellState.notchOpen
onItemsChanged: if (items.length > 0 && !drawer.shown) onItemsChanged: if (items.length > 0 && !drawer.shown)
targetScreen = ScreenService.active targetScreen = ScreenService.active
// Control Center lists everything; banners would cover it. // Control Center lists everything; banners would cover it.
@@ -31,6 +31,11 @@ PanelWindow {
if (ShellState.controlCenterOpen) if (ShellState.controlCenterOpen)
NotificationService.clearPopups(); NotificationService.clearPopups();
} }
// The notch lists everything too.
function onNotchOpenChanged() {
if (ShellState.notchOpen)
NotificationService.clearPopups();
}
} }
anchors { anchors {
+1 -1
View File
@@ -80,7 +80,7 @@ PanelWindow {
} }
function show(next) { function show(next) {
// Control Center already shows these levels. // Control Center already shows these levels.
if (!options.enabled || !armed || ShellState.controlCenterOpen) if (!options.enabled || !armed || ShellState.controlCenterOpen || ShellState.notchOpen)
return; return;
if (!shown) if (!shown)
targetScreen = ScreenService.active; targetScreen = ScreenService.active;
+1
View File
@@ -84,6 +84,7 @@ function validate(c) {
if(!dash || ["enabled","openFromClock","rememberTab","easyEffects"].some(k=>typeof dash[k]!=="boolean") || !["top-left","top-center","top-right","center"].includes(dash.position) || !Array.isArray(dash.tabs))throw Error("Invalid dashboard preferences"); if(!dash || ["enabled","openFromClock","rememberTab","easyEffects"].some(k=>typeof dash[k]!=="boolean") || !["top-left","top-center","top-right","center"].includes(dash.position) || !Array.isArray(dash.tabs))throw Error("Invalid dashboard preferences");
const dashTabs=new Set(); const dashTabs=new Set();
for(const t of dash.tabs) { if(!t || typeof t.id!=="string" || dashTabs.has(t.id) || typeof t.enabled!=="boolean")throw Error("Invalid dashboard tab"); dashTabs.add(t.id); } for(const t of dash.tabs) { if(!t || typeof t.id!=="string" || dashTabs.has(t.id) || typeof t.enabled!=="boolean")throw Error("Invalid dashboard tab"); dashTabs.add(t.id); }
if(!c.notch || ["enabled","mediaFirst"].some(k=>typeof c.notch[k]!=="boolean"))throw Error("Invalid notch preferences");
if(typeof c.osd.enabled!=="boolean" || !["slide","drop","fade","shrink"].includes(c.osd.animation) || !["top-right","top-center","bottom-center"].includes(c.osd.position) || !Number.isInteger(c.osd.timeout) || c.osd.timeout<500 || c.osd.timeout>5000 || !Number.isInteger(c.osd.step) || c.osd.step<1 || c.osd.step>20)throw Error("Invalid OSD preferences"); if(typeof c.osd.enabled!=="boolean" || !["slide","drop","fade","shrink"].includes(c.osd.animation) || !["top-right","top-center","bottom-center"].includes(c.osd.position) || !Number.isInteger(c.osd.timeout) || c.osd.timeout<500 || c.osd.timeout>5000 || !Number.isInteger(c.osd.step) || c.osd.step<1 || c.osd.step>20)throw Error("Invalid OSD preferences");
const notes=c.notifications; const notes=c.notifications;
if(!notes || ["enabled","doNotDisturb","criticalInDnd"].some(k=>typeof notes[k]!=="boolean") || !["slide","drop","fade","shrink"].includes(notes.animation) || !["top-right","top-center"].includes(notes.position) || !Number.isInteger(notes.timeout) || notes.timeout<1000 || notes.timeout>30000 || !Number.isInteger(notes.maxPopups) || notes.maxPopups<1 || notes.maxPopups>6)throw Error("Invalid notification preferences"); if(!notes || ["enabled","doNotDisturb","criticalInDnd"].some(k=>typeof notes[k]!=="boolean") || !["slide","drop","fade","shrink"].includes(notes.animation) || !["top-right","top-center"].includes(notes.position) || !Number.isInteger(notes.timeout) || notes.timeout<1000 || notes.timeout>30000 || !Number.isInteger(notes.maxPopups) || notes.maxPopups<1 || notes.maxPopups>6)throw Error("Invalid notification preferences");
+1
View File
@@ -239,6 +239,7 @@ Singleton {
activePopout.close(); activePopout.close();
activePopout = owner; activePopout = owner;
ShellState.controlCenterOpen = false; ShellState.controlCenterOpen = false;
ShellState.notchOpen = false;
ShellState.dashboardOpen = false; ShellState.dashboardOpen = false;
PopoutState.close(); PopoutState.close();
TrayService.close(); TrayService.close();
+4
View File
@@ -39,6 +39,10 @@ Singleton {
if (!ShellState.controlCenterOpen) if (!ShellState.controlCenterOpen)
root.cancel(); root.cancel();
} }
function onNotchOpenChanged() {
if (!ShellState.notchOpen)
root.cancel();
}
function onSettingsPageChanged() { function onSettingsPageChanged() {
root.cancel(); root.cancel();
} }
+1 -1
View File
@@ -16,7 +16,7 @@ Singleton {
readonly property var features: { readonly property var features: {
if (!ConfigService.ready) if (!ConfigService.ready)
return []; return [];
if (ShellState.controlCenterOpen) if (ShellState.controlCenterOpen || ShellState.notchOpen)
return ConfigService.data.controlCenter.modules.filter(m => m.enabled && ["brightness", "nightLight", "dnd", "profiles", "power"].includes(m.id)).map(m => m.id); return ConfigService.data.controlCenter.modules.filter(m => m.enabled && ["brightness", "nightLight", "dnd", "profiles", "power"].includes(m.id)).map(m => m.id);
if (ShellState.dashboardOpen) if (ShellState.dashboardOpen)
return ["power"]; return ["power"];
+1
View File
@@ -71,6 +71,7 @@ Singleton {
if (!options.enabled || !item || !item.hasMenu || !icon) if (!options.enabled || !item || !item.hasMenu || !icon)
return false; return false;
ShellState.controlCenterOpen = false; ShellState.controlCenterOpen = false;
ShellState.notchOpen = false;
ShellState.launcherOpen = false; ShellState.launcherOpen = false;
ShellState.settingsOpen = false; ShellState.settingsOpen = false;
currentItem = item; currentItem = item;
+6
View File
@@ -302,6 +302,8 @@ PanelWindow {
return osd; return osd;
case "dashboard": case "dashboard":
return dashboardPage; return dashboardPage;
case "notch":
return notchPage;
case "plugins": case "plugins":
return pluginsPage; return pluginsPage;
case "launcher": case "launcher":
@@ -422,6 +424,10 @@ PanelWindow {
id: dashboardPage id: dashboardPage
Pages.Dashboard {} Pages.Dashboard {}
} }
Component {
id: notchPage
Pages.Notch {}
}
Component { Component {
id: lockPage id: lockPage
Pages.Lock {} Pages.Lock {}
+43
View File
@@ -0,0 +1,43 @@
import QtQuick
import "../controls"
import "../../components"
import "../../core"
import "../../services"
SettingsPage {
id: root
readonly property var options: ConfigService.data.notch
SettingsSection {
title: "Notch"
description: "Splits the bar into side islands with a notch at the top centre. Super+C, Super+X and a click on the notch open it: dashboard pages on the left (scroll to switch), controls and weather in the middle, notifications on the right. The launcher drops out of it."
PreferenceToggle {
label: "Notch"
description: root.options.enabled ? "On: notch mode" : "Off: the full bar"
icon: "󰹑"
setting: "notch.enabled"
}
}
SettingsSection {
title: "Opening"
enabled: root.options.enabled
PreferenceToggle {
label: "Open on Media while audio plays"
description: "Otherwise it opens on the last page"
icon: "󰝚"
setting: "notch.mediaFirst"
}
SettingRow {
title: "Preview"
icon: "󰈈"
GlassButton {
objectName: "notchOpenButton"
text: "Open notch"
enabled: root.options.enabled
onClicked: ShellState.openNotch()
}
}
}
SettingNote {
text: "The middle column uses your Control Center tiles; change them in Control Center → Edit Controls."
}
}
+3
View File
@@ -15,6 +15,7 @@ import "widgets"
import "wallpaper" import "wallpaper"
import "controlcenter" import "controlcenter"
import "dashboard" import "dashboard"
import "notch"
import "overview" import "overview"
import "osd" import "osd"
import "notifications" import "notifications"
@@ -37,6 +38,7 @@ ShellRoot {
WallpaperPicker {} WallpaperPicker {}
ControlCenter {} ControlCenter {}
Dashboard {} Dashboard {}
Notch {}
Overview {} Overview {}
PluginHost {} PluginHost {}
Osd {} Osd {}
@@ -106,6 +108,7 @@ ShellRoot {
ShellState.wallpaperPickerOpen = false; ShellState.wallpaperPickerOpen = false;
ShellState.controlCenterOpen = false; ShellState.controlCenterOpen = false;
ShellState.dashboardOpen = false; ShellState.dashboardOpen = false;
ShellState.notchOpen = false;
ShellState.overviewOpen = false; ShellState.overviewOpen = false;
ShellState.settingsOpen = false; ShellState.settingsOpen = false;
ShellState.launcherOpen = false; ShellState.launcherOpen = false;
+1
View File
@@ -142,6 +142,7 @@ Singleton {
function edit(id) { function edit(id) {
ShellState.settingsOpen = false; ShellState.settingsOpen = false;
ShellState.controlCenterOpen = false; ShellState.controlCenterOpen = false;
ShellState.notchOpen = false;
ShellState.launcherOpen = false; ShellState.launcherOpen = false;
ShellState.wallpaperPickerOpen = false; ShellState.wallpaperPickerOpen = false;
selected = id || ""; selected = id || "";