diff options
| -rw-r--r-- | README.md | 1 | ||||
| -rw-r--r-- | config/LauncherConfig.qml | 1 | ||||
| -rw-r--r-- | modules/launcher/Content.qml | 21 |
3 files changed, 23 insertions, 0 deletions
@@ -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 |