From 920c75e99792d18a3215f8125f13358b56bc9039 Mon Sep 17 00:00:00 2001 From: unexplrd Date: Sat, 31 May 2025 14:16:19 +0300 Subject: [PATCH] desktop/niri: lisgd for touchscreen gestures Signed-off-by: unexplrd --- modules/home/desktop/niri/default.nix | 83 +++++++++++++++++---------- modules/nixos/config/users.nix | 11 +++- 2 files changed, 61 insertions(+), 33 deletions(-) diff --git a/modules/home/desktop/niri/default.nix b/modules/home/desktop/niri/default.nix index 54baf3f..5f9cfc1 100644 --- a/modules/home/desktop/niri/default.nix +++ b/modules/home/desktop/niri/default.nix @@ -145,39 +145,60 @@ in { RestartSec = 1; }; }; - in { - udiskie = mkGraphicalService {}; - waybar = mkGraphicalService {}; - network-manager-applet = mkGraphicalService {}; - copyq = mkGraphicalService { - Service = - graphicalService.Service - // { - Environment = mkForce "QT_QPA_PLATFORM=wayland"; + in + lib.mkMerge [ + { + udiskie = mkGraphicalService {}; + waybar = mkGraphicalService {}; + network-manager-applet = mkGraphicalService {}; + copyq = mkGraphicalService { + Service = + graphicalService.Service + // { + Environment = mkForce "QT_QPA_PLATFORM=wayland"; + }; }; - }; - xwayland-satellite = mkGraphicalService { - Service = - graphicalService.Service - // { - Type = "simple"; - ExecStart = getExe pkgs.xwayland-satellite + " :123"; + xwayland-satellite = mkGraphicalService { + Service = + graphicalService.Service + // { + Type = "simple"; + ExecStart = getExe pkgs.xwayland-satellite + " :123"; + }; }; - }; - wpaperd = mkGraphicalService { - Service = - mkDefault graphicalService.Service; - }; - walker = mkGraphicalService {}; - # gnome-polkit-agent = mkGraphicalService { - # Service = - # graphicalService.Service - # // { - # Type = "simple"; - # ExecStart = pkgs.polkit_gnome + "/libexec/polkit-gnome-authentication-agent-1"; - # }; - # }; - }; + wpaperd = mkGraphicalService { + Service = + mkDefault graphicalService.Service; + }; + walker = mkGraphicalService {}; + # gnome-polkit-agent = mkGraphicalService { + # Service = + # graphicalService.Service + # // { + # Type = "simple"; + # ExecStart = pkgs.polkit_gnome + "/libexec/polkit-gnome-authentication-agent-1"; + # }; + # }; + } + (lib.mkIf (hostName == "morphius") { + lisgd = mkGraphicalService { + Service = + graphicalService.Service + // { + # Group = "input"; + Type = "simple"; + ExecStart = + "${pkgs.lisgd}/bin/lisgd" + + " -d /dev/input/by-path/pci-0000:00:15.1-platform-i2c_designware.1-event" + + " -g \"1,DU,TL,*,P,niri msg action toggle-overview\"" + + " -g \"3,UD,T,*,P,niri msg action focus-workspace-up\"" + + " -g \"3,DU,B,*,P,niri msg action focus-workspace-down\"" + + " -g \"3,LR,L,*,P,niri msg action focus-column-left\"" + + " -g \"3,RL,R,*,P,niri msg action focus-column-right\""; + }; + }; + }) + ]; }; }; } diff --git a/modules/nixos/config/users.nix b/modules/nixos/config/users.nix index b39bcf9..7f5605b 100644 --- a/modules/nixos/config/users.nix +++ b/modules/nixos/config/users.nix @@ -2,8 +2,10 @@ inputs, config, pkgs, + lib, ... }: let + inherit (config.networking) hostName; inherit (config.sops) secrets; inherit (inputs) mysecrets; sshKeys = f: "${mysecrets}/ssh/user/id_${f}_ed25519.pub"; @@ -13,15 +15,20 @@ in { users.users = { user = { hashedPasswordFile = secrets."user-password-hashed".path; - extraGroups = ["wheel" "video" "libvirtd" "dialout"]; + extraGroups = + ["wheel" "video" "libvirtd" "dialout"] + /* + for lisgd + */ + ++ lib.optional (hostName == "morphius" && config.desktop.niri.enable) "input"; isNormalUser = true; shell = pkgs.fish; openssh.authorizedKeys.keyFiles = map sshKeys [ "dunamis" "eldrid" - "sarien" "legion" "morphius" + "sarien" ]; }; };