From 7f392acc54ce3a16c4de71a4668da7d07c13dea3 Mon Sep 17 00:00:00 2001 From: Michael Erdely Date: Mon, 16 Mar 2026 15:08:07 +0000 Subject: [PATCH] Implement ability to cycle through launcher modes (#2003) Use Ctrl+Left/Right and Ctrl+H/L to move back and forward through the modes of the launcher --- .../Modals/DankLauncherV2/Controller.qml | 7 ++++-- .../Modals/DankLauncherV2/LauncherContent.qml | 24 +++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/quickshell/Modals/DankLauncherV2/Controller.qml b/quickshell/Modals/DankLauncherV2/Controller.qml index 1334b9b8..52d2135a 100644 --- a/quickshell/Modals/DankLauncherV2/Controller.qml +++ b/quickshell/Modals/DankLauncherV2/Controller.qml @@ -353,10 +353,13 @@ Item { performSearch(); } - function cycleMode() { + function cycleMode(reverse = false) { var modes = ["all", "apps", "files", "plugins"]; var currentIndex = modes.indexOf(searchMode); - var nextIndex = (currentIndex + 1) % modes.length; + if (!reverse) + var nextIndex = (currentIndex + 1) % modes.length; + else + var nextIndex = (currentIndex - 1 + modes.length) % modes.length; setMode(modes[nextIndex]); } diff --git a/quickshell/Modals/DankLauncherV2/LauncherContent.qml b/quickshell/Modals/DankLauncherV2/LauncherContent.qml index d9213094..6b596d41 100644 --- a/quickshell/Modals/DankLauncherV2/LauncherContent.qml +++ b/quickshell/Modals/DankLauncherV2/LauncherContent.qml @@ -158,6 +158,10 @@ FocusScope { controller.selectPageUp(8); return; case Qt.Key_Right: + if (hasCtrl) { + controller.cycleMode(); + return; + } if (controller.getCurrentSectionViewMode() !== "list") { controller.selectRight(); return; @@ -165,12 +169,25 @@ FocusScope { event.accepted = false; return; case Qt.Key_Left: + if (hasCtrl) { + const reverse = true; + controller.cycleMode(reverse); + return; + } if (controller.getCurrentSectionViewMode() !== "list") { controller.selectLeft(); return; } event.accepted = false; return; + case Qt.Key_H: + if (hasCtrl) { + const reverse = true; + controller.cycleMode(reverse); + return; + } + event.accepted = false; + return; case Qt.Key_J: if (hasCtrl) { controller.selectNext(); @@ -185,6 +202,13 @@ FocusScope { } event.accepted = false; return; + case Qt.Key_L: + if (hasCtrl) { + controller.cycleMode(); + return; + } + event.accepted = false; + return; case Qt.Key_N: if (hasCtrl) { controller.selectNextSection();