summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJoel R. <59534812+h0useofdupree@users.noreply.github.com>2025-07-29 04:48:51 +0200
committerGitHub <noreply@github.com>2025-07-29 12:48:51 +1000
commit2539f7b68c19165d233fb4a2eab5dd27715988d7 (patch)
tree3074154f0cb8e20d11184d8f8b8c8051e78ccb3d /modules
parentsession: add custom session/lock menu button commands (#292) (diff)
downloadcaelestia-shell-2539f7b68c19165d233fb4a2eab5dd27715988d7.tar.gz
caelestia-shell-2539f7b68c19165d233fb4a2eab5dd27715988d7.tar.bz2
caelestia-shell-2539f7b68c19165d233fb4a2eab5dd27715988d7.zip
session: add optional vim-like keybinds (#291)
Co-authored-by: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Diffstat (limited to 'modules')
-rw-r--r--modules/session/Content.qml22
1 files changed, 22 insertions, 0 deletions
diff --git a/modules/session/Content.qml b/modules/session/Content.qml
index d90c0bc..4c0bc88 100644
--- a/modules/session/Content.qml
+++ b/modules/session/Content.qml
@@ -98,6 +98,28 @@ Column {
Keys.onEnterPressed: Quickshell.execDetached(button.command)
Keys.onReturnPressed: Quickshell.execDetached(button.command)
Keys.onEscapePressed: root.visibilities.session = false
+ Keys.onPressed: event => {
+ if (!Config.session.vimKeybinds)
+ return;
+
+ if (event.modifiers & Qt.ControlModifier) {
+ if (event.key === Qt.Key_J && KeyNavigation.down) {
+ KeyNavigation.down.focus = true;
+ event.accepted = true;
+ } else if (event.key === Qt.Key_K && KeyNavigation.up) {
+ KeyNavigation.up.focus = true;
+ event.accepted = true;
+ }
+ } else if (event.key === Qt.Key_Tab && KeyNavigation.down) {
+ KeyNavigation.down.focus = true;
+ event.accepted = true;
+ } else if (event.key === Qt.Key_Backtab || (event.key === Qt.Key_Tab && (event.modifiers & Qt.ShiftModifier))) {
+ if (KeyNavigation.up) {
+ KeyNavigation.up.focus = true;
+ event.accepted = true;
+ }
+ }
+ }
StateLayer {
radius: parent.radius