diff --git a/nixos/hardware/framework12/default.nix b/nixos/hardware/framework12/default.nix index 1699adc..fae68c2 100644 --- a/nixos/hardware/framework12/default.nix +++ b/nixos/hardware/framework12/default.nix @@ -28,4 +28,8 @@ environment.systemPackages = [ pkgs.framework-tool ]; + users.groups.touchscreen = {}; + services.udev.extraRules = '' + KERNEL=="event*", ATTRS{name}=="ILIT2901:00 222A:5539", SYMLINK+="touchscreen", MODE="0660", GROUP="touchscreen" + ''; } diff --git a/nixos/homes/kylekrein/lisgd-config.h b/nixos/homes/kylekrein/lisgd-config.h index cca7481..40b1a47 100644 --- a/nixos/homes/kylekrein/lisgd-config.h +++ b/nixos/homes/kylekrein/lisgd-config.h @@ -21,7 +21,7 @@ double edgesizetop = 50.0; double edgesizeright = 50.0; double edgesizebottom = 50.0; double edgessizecaling = 1.0; -char *device = "/dev/input/event7"; +char *device = "/dev/touchscreen"; // Gestures can also be specified interactively from the command line using -g Gesture gestures[] = { @@ -33,20 +33,24 @@ Gesture gestures[] = { "niri msg action focus-workspace-down"}, {1, SwipeUD, CornerTopRight, DistanceMedium, ActModeReleased, "niri msg action focus-workspace-up"}, + {1, SwipeDU, CornerBottomLeft, DistanceShort, ActModeReleased, + "niri msg action switch-preset-column-width"}, //{1, SwipeUD, EdgeTop, DistanceAny, ActModeReleased, "nwggrid -o 0.98"}, //"pkill -SIGRTMIN -f wvkbd"}, //{2, SwipeUD, EdgeAny, DistanceAny, ActModeReleased, - //"sway-interactive-screenshot -s focused-output"}, + //"sway-interactive-screenshot -s focused-output"}, //{3, SwipeLR, EdgeAny, DistanceAny, ActModeReleased, - //"swaymsg layout tabbed"}, + //"swaymsg layout tabbed"}, //{3, SwipeRL, EdgeAny, DistanceAny, ActModeReleased, - //"swaymsg layout toggle split"}, - {2, SwipeUD, EdgeLeft, DistanceShort, ActModePressed, "niri msg action fullscreen-window"}, - {2, SwipeUD, EdgeRight, DistanceMedium, ActModeReleased, "niri msg action close-window"}, + //"swaymsg layout toggle split"}, + {2, SwipeUD, EdgeLeft, DistanceShort, ActModePressed, + "niri msg action fullscreen-window"}, + {2, SwipeUD, EdgeRight, DistanceMedium, ActModeReleased, + "niri msg action close-window"}, {2, SwipeDU, EdgeBottom, DistanceAny, ActModeReleased, "pkill -34 -f wvkbd"}, //{2, SwipeUD, EdgeBottom, DistanceAny, ActModeReleased, - //"pkill -9 -f wvkbd-mobintl"}, + //"pkill -9 -f wvkbd-mobintl"}, {3, SwipeDU, EdgeAny, DistanceAny, ActModeReleased, "niri msg action toggle-overview"}, }; diff --git a/nixos/homes/kylekrein/niri.nix b/nixos/homes/kylekrein/niri.nix index 1e39674..666a15f 100644 --- a/nixos/homes/kylekrein/niri.nix +++ b/nixos/homes/kylekrein/niri.nix @@ -69,7 +69,7 @@ in { }; touchscreen-gestures = lib.mkIf (hwconfig.hasTouchscreen) { command = [ - "while true; do ${lisgd-patched}/bin/lisgd; done" #https://git.sr.ht/~mil/lisgd + "${lisgd-patched}/bin/lisgd" #https://git.sr.ht/~mil/lisgd ]; }; touchscreen-keyboard = lib.mkIf (hwconfig.hasTouchscreen) { @@ -117,7 +117,7 @@ in { } { command = [ - "emacs" + "${config.programs.emacs.package}/bin/emacs" "--daemon" ]; } @@ -228,6 +228,12 @@ in { QT_QPA_PLATFORM = "wayland"; DISPLAY = ":0"; }; + layer-rules = [ + { + #this is for later to place keyboard on top of hyprlock + matches = [{namespace = "wvkbd";}]; + } + ]; window-rules = [ { #active @@ -345,4 +351,19 @@ in { }; }; }; + systemd.user.services.lisgd-niri = lib.mkIf (hwconfig.hasTouchscreen) { + Unit = { + Description = "Makes sure that you have touchscreen gestures."; + }; + Install = { + WantedBy = ["default.target"]; + }; + Service = { + ExecStart = "${pkgs.writeShellScript "run-lisgd" '' + ${lisgd-patched}/bin/lisgd + ''}"; + Restart = "on-failure"; + RestartSec = 5; + }; + }; } diff --git a/nixos/users/kylekrein/default.nix b/nixos/users/kylekrein/default.nix index 9e58324..e880a01 100644 --- a/nixos/users/kylekrein/default.nix +++ b/nixos/users/kylekrein/default.nix @@ -14,10 +14,11 @@ in { users.users.${username} = { isNormalUser = true; description = "Aleksandr Lebedev"; - extraGroups = ["networkmanager" "wheel" "input"]; + extraGroups = ["networkmanager" "wheel" "input" "touchscreen"]; #initialPassword = "1234"; hashedPasswordFile = config.sops.secrets."users/${username}".path; packages = with pkgs; []; + linger = true; openssh.authorizedKeys.keys = [ "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIGMt3PWVvmEL6a0HHTsxL4KMq1UGKFdzgX5iIkm6owGQ kylekrein@kylekrein-mac"