Mapped touchscreen to /dev/touchscreen, fixed touch gestures

But you're unable to unlock the framework12 without keyboard (virtual
keyboard doesn't appear)
This commit is contained in:
Aleksandr Lebedev 2025-07-31 00:24:05 +02:00
parent 45dbea7758
commit 40c709b116
4 changed files with 40 additions and 10 deletions

View file

@ -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"
'';
}

View file

@ -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"},
};

View file

@ -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;
};
};
}

View file

@ -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"