summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel R. <59534812+h0useofdupree@users.noreply.github.com>2025-07-28 05:08:54 +0200
committerGitHub <noreply@github.com>2025-07-28 13:08:54 +1000
commit4feeaaabc68dd3fca32222db555dc9b9d670f913 (patch)
treea1e2368a8d840b85374235d2d254788f32a8a78b
parentbar: fix kb layout (diff)
downloadcaelestia-shell-4feeaaabc68dd3fca32222db555dc9b9d670f913.tar.gz
caelestia-shell-4feeaaabc68dd3fca32222db555dc9b9d670f913.tar.bz2
caelestia-shell-4feeaaabc68dd3fca32222db555dc9b9d670f913.zip
launcher: add optional vim-like keybinds (#282)
-rw-r--r--README.md1
-rw-r--r--config/LauncherConfig.qml1
-rw-r--r--modules/launcher/Content.qml21
3 files changed, 23 insertions, 0 deletions
diff --git a/README.md b/README.md
index 52fa61d..42d973a 100644
--- a/README.md
+++ b/README.md
@@ -181,6 +181,7 @@ All configuration options are in `~/.config/caelestia/shell.json`.
"launcher": {
"actionPrefix": ">",
"dragThreshold": 50,
+ "vimKeybinds": false,
"enableDangerousActions": false,
"maxShown": 8,
"maxWallpapers": 9,
diff --git a/config/LauncherConfig.qml b/config/LauncherConfig.qml
index 70465a0..9364b91 100644
--- a/config/LauncherConfig.qml
+++ b/config/LauncherConfig.qml
@@ -7,6 +7,7 @@ JsonObject {
property string actionPrefix: ">"
property bool enableDangerousActions: false // Allow actions that can cause losing data, like shutdown, reboot and logout
property int dragThreshold: 50
+ property bool vimKeybinds: false
property UseFuzzy useFuzzy: UseFuzzy {}
property Sizes sizes: Sizes {}
diff --git a/modules/launcher/Content.qml b/modules/launcher/Content.qml
index e887bf9..0c41456 100644
--- a/modules/launcher/Content.qml
+++ b/modules/launcher/Content.qml
@@ -102,6 +102,27 @@ Item {
Keys.onEscapePressed: root.visibilities.launcher = false
+ Keys.onPressed: event => {
+ if (!Config.launcher.vimKeybinds)
+ return;
+
+ if (event.modifiers & Qt.ControlModifier) {
+ if (event.key === Qt.Key_J) {
+ list.currentList?.incrementCurrentIndex();
+ event.accepted = true;
+ } else if (event.key === Qt.Key_K) {
+ list.currentList?.decrementCurrentIndex();
+ event.accepted = true;
+ }
+ } else if (event.key === Qt.Key_Tab) {
+ list.currentList?.incrementCurrentIndex();
+ event.accepted = true;
+ } else if (event.key === Qt.Key_Backtab || (event.key === Qt.Key_Tab && (event.modifiers & Qt.ShiftModifier))) {
+ list.currentList?.decrementCurrentIndex();
+ event.accepted = true;
+ }
+ }
+
Connections {
target: root.visibilities