horriblename / hyprgrass

hyprland plugin for touch gestures
BSD 3-Clause "New" or "Revised" License
268 stars 11 forks source link

testing gestures #143

Closed nebunebu closed 3 months ago

nebunebu commented 3 months ago

I'm on a Lenovo Thinkpad x230t, which has tablet functionality.

my flake inputs for hyprland and hyprgrass:

    hyprland = {
      type = "git";
      url = "https://github.com/hyprwm/Hyprland";
      rev = "9e781040d9067c2711ec2e9f5b47b76ef70762b3"; #v0.41.1
      submodules = true;
    };

    hyprgrass = {
      type = "git";
      url = "https://github.com/horriblename/hyprgrass";
      rev = "736119f828eecaed2deaae1d6ff1f50d6dabaaba"; # merge of v0.7.0
      # rev = "fd2eed1829dbc4f859ee05b5e70056127cae4038"; # v0.7.0
      inputs.hyprland.follows = "hyprland";
    };

my configuration for hyprgrass:

{ lib, inputs, config, pkgs, ... }:
let
  cfg = config.desktop.hyprland.hyprgrass;
in
{
  options.desktop.hyprland.hyprgrass.enable = lib.mkEnableOption "enable hyprgrass";

  config = lib.mkIf cfg.enable {
    wayland.windowManager.hyprland = {
      plugins = [
        inputs.hyprgrass.packages."${pkgs.system}".default
      ];

      extraConfig = /* hyprlang */ ''
        plugin:touch_gestures {
          sensitivity = 7.0
          long_press_delay = 400

          # Swipe gestures
          hyprgrass-bind = , swipe:3:l, exec, notify-send "hyprgrass" "swipe:3:l"
          hyprgrass-bind = , swipe:3:r, exec, notify-send "hyprgrass" "swipe:3:r"
          hyprgrass-bind = , swipe:3:u, exec, notify-send "hyprgrass" "swipe:3:u"
          hyprgrass-bind = , swipe:3:d, exec, notify-send "hyprgrass" "swipe:3:d"
          hyprgrass-bind = , swipe:3:ld, exec, notify-send "hyprgrass" "swipe:3:ld"
          hyprgrass-bind = , swipe:3:rd, exec, notify-send "hyprgrass" "swipe:3:rd"
          hyprgrass-bind = , swipe:3:lu, exec, notify-send "hyprgrass" "swipe:3:lu"
          hyprgrass-bind = , swipe:3:ru, exec, notify-send "hyprgrass" "swipe:3:ru"

          hyprgrass-bind = , swipe:4:l, exec, notify-send "hyprgrass" "swipe:4:l"
          hyprgrass-bind = , swipe:4:r, exec, notify-send "hyprgrass" "swipe:4:r"
          hyprgrass-bind = , swipe:4:u, exec, notify-send "hyprgrass" "swipe:4:u"
          hyprgrass-bind = , swipe:4:d, exec, notify-send "hyprgrass" "swipe:4:d"
          hyprgrass-bind = , swipe:4:ld, exec, notify-send "hyprgrass" "swipe:4:ld"
          hyprgrass-bind = , swipe:4:rd, exec, notify-send "hyprgrass" "swipe:4:rd"
          hyprgrass-bind = , swipe:4:lu, exec, notify-send "hyprgrass" "swipe:4:lu"
          hyprgrass-bind = , swipe:4:ru, exec, notify-send "hyprgrass" "swipe:4:ru"

          hyprgrass-bind = , swipe:5:l, exec, notify-send "hyprgrass" "swipe:5:l"
          hyprgrass-bind = , swipe:5:r, exec, notify-send "hyprgrass" "swipe:5:r"
          hyprgrass-bind = , swipe:5:u, exec, notify-send "hyprgrass" "swipe:5:u"
          hyprgrass-bind = , swipe:5:d, exec, notify-send "hyprgrass" "swipe:5:d"
          hyprgrass-bind = , swipe:5:ld, exec, notify-send "hyprgrass" "swipe:5:ld"
          hyprgrass-bind = , swipe:5:rd, exec, notify-send "hyprgrass" "swipe:5:rd"
          hyprgrass-bind = , swipe:5:lu, exec, notify-send "hyprgrass" "swipe:5:lu"
          hyprgrass-bind = , swipe:5:ru, exec, notify-send "hyprgrass" "swipe:5:ru"

          # Tap gestures
          hyprgrass-bind = , tap:3, exec, notify-send "hyprgrass" "tap:3"
          hyprgrass-bind = , tap:4, exec, notify-send "hyprgrass" "tap:4"
          hyprgrass-bind = , tap:5, exec, notify-send "hyprgrass" "tap:5"

          # Edge gestures
          hyprgrass-bind = , edge:l:r, exec, notify-send "hyprgrass" "edge:l:r"
          hyprgrass-bind = , edge:l:u, exec, notify-send "hyprgrass" "edge:l:u"
          hyprgrass-bind = , edge:l:d, exec, notify-send "hyprgrass" "edge:l:d"
          hyprgrass-bind = , edge:l:ru, exec, notify-send "hyprgrass" "edge:l:ru"
          hyprgrass-bind = , edge:l:rd, exec, notify-send "hyprgrass" "edge:l:rd"

          hyprgrass-bind = , edge:r:l, exec, notify-send "hyprgrass" "edge:r:l"
          hyprgrass-bind = , edge:r:u, exec, notify-send "hyprgrass" "edge:r:u"
          hyprgrass-bind = , edge:r:d, exec, notify-send "hyprgrass" "edge:r:d"
          hyprgrass-bind = , edge:r:lu, exec, notify-send "hyprgrass" "edge:r:lu"
          hyprgrass-bind = , edge:r:ld, exec, notify-send "hyprgrass" "edge:r:ld"

          hyprgrass-bind = , edge:u:l, exec, notify-send "hyprgrass" "edge:u:l"
          hyprgrass-bind = , edge:u:r, exec, notify-send "hyprgrass" "edge:u:r"
          hyprgrass-bind = , edge:u:d, exec, notify-send "hyprgrass" "edge:u:d"
          hyprgrass-bind = , edge:u:ld, exec, notify-send "hyprgrass" "edge:u:ld"
          hyprgrass-bind = , edge:u:rd, exec, notify-send "hyprgrass" "edge:u:rd"

          hyprgrass-bind = , edge:d:l, exec, notify-send "hyprgrass" "edge:d:l"
          hyprgrass-bind = , edge:d:r, exec, notify-send "hyprgrass" "edge:d:r"
          hyprgrass-bind = , edge:d:u, exec, notify-send "hyprgrass" "edge:d:u"
          hyprgrass-bind = , edge:d:lu, exec, notify-send "hyprgrass" "edge:d:lu"
          hyprgrass-bind = , edge:d:ru, exec, notify-send "hyprgrass" "edge:d:ru"

          # Long press gestures
          hyprgrass-bind = , longpress:1, exec, notify-send "hyprgrass" "longpress:1"
          hyprgrass-bind = , longpress:2, exec, notify-send "hyprgrass" "longpress:2"
          hyprgrass-bind = , longpress:3, exec, notify-send "hyprgrass" "longpress:3"
          hyprgrass-bind = , longpress:4, exec, notify-send "hyprgrass" "longpress:4"
          hyprgrass-bind = , longpress:5, exec, notify-send "hyprgrass" "longpress:5"
                  }
      '';
    };
  };
}

The main point of interest and the actual reason for making this issue is I attempted to exhaust possible hyprgrass-binds and have them exec a notification of which bind was used.

Some of these issues may be setting things up incorrectly.

Swipe gestures

None of the swipe gestures work, for instance hyprgrass-bind = , swipe:3:l, exec, notify-send "hyprgrass" "swipe:3:l". I am starting at the center of the screen and swiping leftward with three fingers.

Tap gestures

I've also been able to get any of the tap gestures to work. I am just taping the screen with 3, 4, or 5 fingers.

Edge gestures

These work

Long press gestures

longpress:1 and longpress:2 work. Any finger count greater than 2 is interpreted as longpress:2

Speculation

Because longpressing with three or more fingers is interpreted as a longpress with two fingures, I suspect this is also why swipe and tap gestures are not working, since they require a finger count of at least 3.

I am not sure whether this is because of the hardware I am on or in what ways I could test this.

Any insight is appreciated.

nebunebu commented 3 months ago

Figured out that the screen is a two-touch display.