From e0ab0a6b9011ecfb367742ced417840acdde9539 Mon Sep 17 00:00:00 2001 From: purian23 Date: Thu, 4 Jun 2026 23:23:03 -0400 Subject: [PATCH] feat(keybinds): new mango overview workspace pill & keybind updates --- core/internal/config/embedded/hypr-binds.lua | 1 + .../internal/config/embedded/mango-binds.conf | 6 +++ core/internal/config/embedded/niri-binds.kdl | 2 +- .../DankBar/Widgets/WorkspaceSwitcher.qml | 47 +++++++++++++++++++ quickshell/Services/MangoService.qml | 10 ++++ 5 files changed, 65 insertions(+), 1 deletion(-) diff --git a/core/internal/config/embedded/hypr-binds.lua b/core/internal/config/embedded/hypr-binds.lua index e2c26fb3..ad4b5f95 100644 --- a/core/internal/config/embedded/hypr-binds.lua +++ b/core/internal/config/embedded/hypr-binds.lua @@ -11,6 +11,7 @@ hl.bind("SUPER + N", hl.dsp.exec_cmd("dms ipc call notifications toggle")) hl.bind("SUPER + SHIFT + N", hl.dsp.exec_cmd("dms ipc call notepad toggle")) hl.bind("SUPER + Y", hl.dsp.exec_cmd("dms ipc call dankdash wallpaper")) hl.bind("SUPER + TAB", hl.dsp.exec_cmd("dms ipc call hypr toggleOverview")) +hl.bind("SUPER + O", hl.dsp.exec_cmd("dms ipc call hypr toggleOverview")) hl.bind("SUPER + X", hl.dsp.exec_cmd("dms ipc call powermenu toggle")) -- === Cheat sheet diff --git a/core/internal/config/embedded/mango-binds.conf b/core/internal/config/embedded/mango-binds.conf index 4d34cc03..546b4156 100644 --- a/core/internal/config/embedded/mango-binds.conf +++ b/core/internal/config/embedded/mango-binds.conf @@ -84,6 +84,9 @@ bind=SUPER,f,togglefullscreen, bind=SUPER,a,togglemaximizescreen, # Toggle Floating bind=SUPER+SHIFT,space,togglefloating, +# Toggle Overview +bind=SUPER,o,toggleoverview +bind=ALT,Tab,toggleoverview # Exit Compositor bind=SUPER+SHIFT,e,quit, @@ -174,3 +177,6 @@ bind=SUPER+SHIFT,9,tag,9 # 3-finger horizontal swipe: switch between occupied workspaces gesturebind=none,left,3,viewtoleft_have_client gesturebind=none,right,3,viewtoright_have_client +# 4-finger vertical swipe: toggle the overview +gesturebind=none,up,4,toggleoverview +gesturebind=none,down,4,toggleoverview diff --git a/core/internal/config/embedded/niri-binds.kdl b/core/internal/config/embedded/niri-binds.kdl index a08f5801..414ece73 100644 --- a/core/internal/config/embedded/niri-binds.kdl +++ b/core/internal/config/embedded/niri-binds.kdl @@ -1,6 +1,6 @@ binds { // === System & Overview === - Mod+D repeat=false { toggle-overview; } + Mod+O repeat=false { toggle-overview; } Mod+Tab repeat=false { toggle-overview; } Mod+Shift+Slash { show-hotkey-overlay; } diff --git a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml index 6d43e67e..7da4fa8e 100644 --- a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml +++ b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml @@ -945,6 +945,53 @@ Item { spacing: Theme.spacingS flow: isVertical ? Flow.TopToBottom : Flow.LeftToRight + // mango reports active_tags=0 while the overview is open; surface it as a pill + Item { + id: overviewPill + visible: CompositorService.isMango && MangoService.inOverview + width: root.isVertical ? root.widgetHeight : overviewBg.width + height: root.isVertical ? overviewBg.height : root.widgetHeight + + readonly property real labelSize: Theme.barTextSize(root.barThickness, root.barConfig?.fontScale, root.barConfig?.maximizeWidgetText) + + Rectangle { + id: overviewBg + anchors.centerIn: parent + width: root.isVertical ? Math.max(root.widgetHeight * 0.7, overviewContent.implicitWidth + Theme.spacingS) : (overviewContent.implicitWidth + Theme.spacingS * 2) + height: Math.max(root.widgetHeight * 0.5, overviewContent.implicitHeight + Theme.spacingXS) + radius: Theme.cornerRadius + color: Theme.withAlpha(Theme.primary, 0.18) + + Row { + id: overviewContent + anchors.centerIn: parent + spacing: Theme.spacingXS + + DankIcon { + anchors.verticalCenter: parent.verticalCenter + name: "grid_view" + size: overviewPill.labelSize + 2 + color: Theme.primary + } + + StyledText { + anchors.verticalCenter: parent.verticalCenter + visible: !root.isVertical + text: I18n.tr("OVERVIEW") + color: Theme.primary + font.pixelSize: overviewPill.labelSize + font.weight: Font.DemiBold + } + } + } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + onClicked: Quickshell.execDetached(["mmsg", "dispatch", "toggleoverview"]) + } + } + Repeater { id: workspaceRepeater model: ScriptModel { diff --git a/quickshell/Services/MangoService.qml b/quickshell/Services/MangoService.qml index b4a559a1..b09e3abd 100644 --- a/quickshell/Services/MangoService.qml +++ b/quickshell/Services/MangoService.qml @@ -33,6 +33,7 @@ Singleton { // tags: [{ tag, state, clients, focused, urgent, layout }] } property var outputs: ({}) property string activeOutput: "" + readonly property bool inOverview: isOutputInOverview(activeOutput) property int tagCount: 9 property var displayScales: ({}) property string currentKeyboardLayout: "" @@ -173,6 +174,15 @@ Singleton { return output.tags.filter(tag => tag.state === 1).map(tag => tag.tag); } + // mango reports active_tags=[0] (no real tag selected) while the overview is open. + function isOutputInOverview(outputName) { + const output = getOutputState(outputName); + if (!output) + return false; + const at = output.activeTags || []; + return at.length === 0 || at.every(t => t === 0); + } + function getTagsWithClients(outputName) { const output = getOutputState(outputName); if (!output || !output.tags)