Open the equalizer from the notch's album art, and add notch view commands

Clicking the artwork on the notch's Media page swaps in the dashboard's
EasyEffects equalizer as a full view, the way Performance opens
"Your computer". `glassmxrph notch equalizer|computer` opens the notch
straight onto either view (or the matching dashboard tab with the full bar).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
mxandClaude Opus 5.5 committed 2026-11-19 00:52:59 +01:00
1 parent a0de1d2c41
commit fc272e45b2
4 files changed
+104 -24

No files matched your search

+13
View File
@@ -92,6 +92,19 @@ Singleton {
else
openNotch();
}
// Opens the notch straight onto a full view ("computer" or "equalizer");
// asked again on that view, it closes. With the full bar, the matching
// dashboard tab opens instead.
function toggleNotchView(view) {
if (!notchMode)
return toggleDashboard(view === "computer" ? "performance" : "media");
if (notchOpen && notchView === view) {
notchOpen = false;
return;
}
openNotch();
notchView = view;
}
onNotchModeChanged: if (!notchMode)
notchOpen = false
// Super+N: swaps between notch mode and the full bar.
+55 -21
View File
@@ -18,7 +18,8 @@ import "../widgets/faces" as Faces
// 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.
// Clicking Performance swaps in the full "Your computer" view, and clicking
// the album art swaps in the EasyEffects equalizer.
// The layer is sized to the shape so HyprGlass follows its outline.
// qmllint disable uncreatable-type
PanelWindow {
@@ -29,6 +30,12 @@ PanelWindow {
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 bool equalizer: ShellState.notchView === "equalizer"
// A full view replaces the three columns.
readonly property bool detail: computer || equalizer
readonly property bool equalizerShown: ShellState.notchOpen && equalizer
onEqualizerShownChanged: if (equalizerShown)
EasyEffectsService.refresh()
readonly property real ear: BarDrawers.ear
readonly property real band: BarDrawers.bottom
readonly property int pad: 22
@@ -42,11 +49,11 @@ PanelWindow {
// 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(600, middle.contentHeight + header + gutter + 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)
readonly property Item detailItem: (equalizer ? equalizerView.item : computerView.item) as Item
readonly property real detailWidth: (detailItem ? detailItem.implicitWidth : equalizer ? 400 : 800) + 2 * pad
readonly property real detailHeight: band + 44 + (detailItem ? detailItem.implicitHeight : 400) + pad
readonly property real openWidth: Math.min(screenWidth - 2 * (BarDrawers.margin + ear) - 40, detail ? detailWidth : mainWidth)
readonly property real openHeight: Math.min(screenHeight - 40, detail ? detailHeight : mainHeight)
property real progress: ShellState.notchOpen ? 1 : 0
Behavior on progress {
NumberAnimation {
@@ -187,7 +194,7 @@ PanelWindow {
Keys.onEscapePressed: {
if (middle.editing)
middle.editing = false;
else if (root.computer)
else if (root.detail)
ShellState.notchView = "main";
else
ShellState.notchOpen = false;
@@ -227,7 +234,7 @@ PanelWindow {
// Header: chosen bar modules left of the clock (the wheel scrolls them
// sideways), the tile editor cog, and a divider under it all.
readonly property bool headerShown: !root.computer && root.contentOpacity > 0
readonly property bool headerShown: !root.detail && root.contentOpacity > 0
Flickable {
id: strip
objectName: "notchStrip"
@@ -332,7 +339,7 @@ PanelWindow {
width: root.mainWidth - 2 * root.pad
height: root.targetHeight - root.header - root.gutter - root.pad
visible: opacity > 0
opacity: root.computer ? 0 : root.contentOpacity
opacity: root.detail ? 0 : root.contentOpacity
Behavior on opacity {
enabled: root.settled
NumberAnimation {
@@ -1010,15 +1017,37 @@ PanelWindow {
}
}
// "Your computer": the dashboard's Performance tab -------------------
Item {
// Full views: "Your computer" (the dashboard's Performance tab) and
// the dashboard's EasyEffects equalizer ------------------------------
DetailView {
id: computerView
view: "computer"
title: "Your computer"
source: DashboardRegistry.entry("performance").source
}
DetailView {
id: equalizerView
view: "equalizer"
title: "Equalizer"
source: Qt.resolvedUrl("../dashboard/Equalizer.qml")
}
}
// A full view: a back pill over the loaded page, shown while it is the
// notch's view.
component DetailView: Item {
id: detailView
required property string view
property string title
property alias source: detailLoader.source
readonly property bool shown: ShellState.notchView === view
readonly property var item: detailLoader.item
x: root.pad
y: root.band
width: root.bodyWidth - 2 * root.pad
height: Math.max(0, root.bodyHeight - root.band - root.pad)
visible: opacity > 0
opacity: root.computer ? root.contentOpacity : 0
opacity: shown ? root.contentOpacity : 0
Behavior on opacity {
enabled: root.settled
NumberAnimation {
@@ -1026,8 +1055,7 @@ PanelWindow {
}
}
Rectangle {
id: back
objectName: "notchBack"
objectName: detailView.view === "computer" ? "notchBack" : "notchBack-" + detailView.view
width: backLabel.implicitWidth + 28
height: 30
radius: 15
@@ -1037,7 +1065,7 @@ PanelWindow {
Text {
id: backLabel
anchors.centerIn: parent
text: (Icons.available ? "󰅁 " : "‹ ") + "Your computer"
text: (Icons.available ? "󰅁 " : "‹ ") + detailView.title
color: Theme.text
font.pixelSize: 13
font.weight: Font.DemiBold
@@ -1051,13 +1079,12 @@ PanelWindow {
}
}
Loader {
id: computerLoader
id: detailLoader
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)
}
active: ShellState.notchOpen && detailView.shown
onLoaded: if ("current" in item)
item.current = Qt.binding(() => ShellState.notchOpen && detailView.shown)
}
}
@@ -1082,7 +1109,14 @@ PanelWindow {
return ShellState.toggleNotchMode();
}
function view(name: string): void {
ShellState.notchView = name === "computer" ? "computer" : "main";
ShellState.notchView = name === "computer" || name === "equalizer" ? name : "main";
}
// Open straight onto a full view; again on that view closes the notch.
function computer(): void {
ShellState.toggleNotchView("computer");
}
function equalizer(): void {
ShellState.toggleNotchView("equalizer");
}
function status(): string {
return JSON.stringify({
+33 -1
View File
@@ -2,12 +2,14 @@ pragma ComponentBehavior: Bound
import QtQuick
import Quickshell.Widgets
import "../components"
import "../core"
import "../dashboard"
import "../services"
import "../theme"
// The notch's Media page: large artwork, track, seek bar, transport and a
// Cava strip, sized to fill the left column.
// Cava strip, sized to fill the left column. Clicking the artwork opens the
// equalizer view (when the dashboard's EasyEffects equalizer is on).
Item {
id: root
property bool active: false
@@ -15,6 +17,7 @@ Item {
readonly property bool live: MediaService.length <= 0 || MediaService.length > 7 * 86400
readonly property bool hasPlayer: !!MediaService.player
readonly property real artSize: Math.max(120, Math.min(width - 40, height - 250, 250))
readonly property bool equalizer: ConfigService.ready && !!ConfigService.data.dashboard && ConfigService.data.dashboard.easyEffects
Demand {
service: MediaService
counter: "progressConsumers"
@@ -60,6 +63,35 @@ Item {
}
}
}
// Hover hint for the equalizer.
Rectangle {
anchors.fill: parent
color: Qt.alpha("black", 0.45)
opacity: artArea.containsMouse ? 1 : 0
Behavior on opacity {
NumberAnimation {
duration: Theme.notchDuration / 2
}
}
Text {
anchors.centerIn: parent
text: "Equalizer"
color: "white"
font.pixelSize: 15
font.weight: Font.DemiBold
}
}
MouseArea {
id: artArea
objectName: "notchArtwork"
anchors.fill: parent
enabled: root.equalizer
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: ShellState.notchView = "equalizer"
Accessible.role: Accessible.Button
Accessible.name: "Equalizer"
}
}
Column {
width: parent.width
+3 -2
View File
@@ -51,7 +51,8 @@ case "${1:-run}" in
exec quickshell ipc --path "$project_dir/quickshell" call dashboard toggle "${2:-}"
;;
notch)
# glassmxrph notch [toggle|open|close|mode]; mode swaps notch mode and the full bar
# glassmxrph notch [toggle|open|close|mode|computer|equalizer]; mode swaps notch mode and the full bar,
# computer/equalizer open the notch straight onto that view (or the dashboard tab with the full bar)
action=${2:-toggle}
[ "$action" = mode ] && action=toggleMode
exec quickshell ipc --path "$project_dir/quickshell" call notch "$action"
@@ -79,5 +80,5 @@ case "${1:-run}" in
settings|close|status)
exec quickshell ipc --path "$project_dir/quickshell" call shell "$1"
;;
*) echo 'Usage: glassmxrph [run|wallpaper|launcher|overview|clipboard|emoji|dashboard [TAB]|notch [toggle|mode]|plugin ACTION|controlcenter|lock|widgets|osd ACTION|notifications ACTION|settings|close|status|doctor]' >&2; exit 2 ;;
*) echo 'Usage: glassmxrph [run|wallpaper|launcher|overview|clipboard|emoji|dashboard [TAB]|notch [toggle|mode|computer|equalizer]|plugin ACTION|controlcenter|lock|widgets|osd ACTION|notifications ACTION|settings|close|status|doctor]' >&2; exit 2 ;;
esac