From 372e268cb0569314771ffc5730c5d1f7951c65ac Mon Sep 17 00:00:00 2001 From: Kopatz <7265381+Kropatz@users.noreply.github.com> Date: Mon, 29 Dec 2025 15:49:32 +0100 Subject: [PATCH] add cursor submap --- home-manager/hyprland/hyprland-settings.nix | 44 +++++++++++++++++++++ pkgs/kop-pvlog/default.nix | 2 +- 2 files changed, 45 insertions(+), 1 deletion(-) diff --git a/home-manager/hyprland/hyprland-settings.nix b/home-manager/hyprland/hyprland-settings.nix index 1e8378f..8de7317 100644 --- a/home-manager/hyprland/hyprland-settings.nix +++ b/home-manager/hyprland/hyprland-settings.nix @@ -415,6 +415,8 @@ in node = "${pkgs.nodejs}/bin/node"; set-monitor = "~/.config/hypr/monitor-config.js"; answer = "${pkgs.answer}/bin/answer"; + wlrctl = "${pkgs.wlrctl}/bin/wlrctl"; + wl-kbptr = "${pkgs.wl-kbptr}/bin/wl-kbptr"; in '' bind = $mainMod, A, submap, notes @@ -448,8 +450,50 @@ in #bind = $mainMod, 0, exec, cat ~/Nextcloud/test.txt | ${wl-copy} bind = , escape, submap, reset + + # Cursor submap (similar to the Mouse mode in Sway) + submap=cursor + + # Jump cursor to a position + bind=,a,exec,hyprctl dispatch submap reset && ${wl-kbptr} && hyprctl dispatch submap cursor + + # Cursor movement + binde=,J,exec,${wlrctl} pointer move 0 10 + binde=,K,exec,${wlrctl} pointer move 0 -10 + binde=,L,exec,${wlrctl} pointer move 10 0 + binde=,H,exec,${wlrctl} pointer move -10 0 + binde=SHIFT,J,exec,${wlrctl} pointer move 0 50 + binde=SHIFT,K,exec,${wlrctl} pointer move 0 -50 + binde=SHIFT,L,exec,${wlrctl} pointer move 50 0 + binde=SHIFT,H,exec,${wlrctl} pointer move -50 0 + + # Left button + bind=,S,exec,${wlrctl} pointer click left + # Middle button + bind=,D,exec,${wlrctl} pointer click middle + # Right button + bind=,F,exec,${wlrctl} pointer click right + + # Scroll up and down + binde=,E,exec,${wlrctl} pointer scroll 10 0 + binde=,R,exec,${wlrctl} pointer scroll -10 0 + + # Scroll left and right + binde=,T,exec,${wlrctl} pointer scroll 0 -10 + binde=,G,exec,${wlrctl} pointer scroll 0 10 + + # Exit cursor submap + # If you do not use cursor timeout or cursor:hide_on_key_press, you can delete its respective calls. + bind=,escape,exec, hyprctl dispatch submap reset + submap = reset + # Entrypoint + # If you do not use cursor timeout or cursor:hide_on_key_press, you can delete its respective calls. + bind=$mainMod,g,exec,hyprctl dispatch submap cursor + + + ''; #experimental:explicit_sync = true }; diff --git a/pkgs/kop-pvlog/default.nix b/pkgs/kop-pvlog/default.nix index ed3d845..dd79229 100644 --- a/pkgs/kop-pvlog/default.nix +++ b/pkgs/kop-pvlog/default.nix @@ -12,7 +12,7 @@ buildGoModule rec { src = fetchGit { url = "gitolite@kopatz.dev:kop-pvlog.git"; ref = "master"; - rev = "3e14e3613cc2502edf483228c0a39a2c90563909"; + rev = "62dd0ddbaa4c12dc0588bc8086d77a7e04be9c76"; }; vendorHash = "sha256-8wYERVt3PIsKkarkwPu8Zy/Sdx43P6g2lz2xRfvTZ2E=";