fix: random keypress stuck

This commit is contained in:
2026-04-28 14:55:25 +02:00
parent e8a3a3ef43
commit 73d1bf60ce
2 changed files with 20 additions and 1 deletions
+12 -1
View File
@@ -1,5 +1,8 @@
# https://discourse.nixos.org/t/what-is-the-best-option-for-power-management/63406/2 # https://discourse.nixos.org/t/what-is-the-best-option-for-power-management/63406/2
{...}: {
lib,
config,
...}:
# we just activate tlp unconditonally # we just activate tlp unconditonally
#let #let
# cfg = config.custom; # cfg = config.custom;
@@ -18,6 +21,14 @@
# config = lib.mkIf cfg.battery.enable { # config = lib.mkIf cfg.battery.enable {
powerManagement.powertop.enable = true; # enable powertop auto tuning on startup. powerManagement.powertop.enable = true; # enable powertop auto tuning on startup.
# Acording to https://community.frame.work/t/solved-keys-stick-and-repeat-after-being-released/51153/12
# Some powertop bug is responsable for the problem of the random keypress being stuck
# fix: from https://git.gabbie.blue/blue/nixconf/src/commit/2d1bc6dad4684c019b6b3e894408e76e2734806c/hosts/gabbielaptop/configuration.nix#L68
powerManagement.powertop.postStart = ''
${lib.getExe' config.systemd.package "udevadm"} trigger -c bind -s usb -a idVendor=32ac -a idProduct=0018
# Retrigger macropad udev rules
${lib.getExe' config.systemd.package "udevadm"} trigger -c bind -s usb -a idVendor=32ac -a idProduct=0013
'';
services.system76-scheduler.settings.cfsProfiles.enable = true; # Better scheduling for CPU cycles - thanks System76!!! services.system76-scheduler.settings.cfsProfiles.enable = true; # Better scheduling for CPU cycles - thanks System76!!!
services.thermald.enable = true; # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs) services.thermald.enable = true; # Enable thermald, the temperature management daemon. (only necessary if on Intel CPUs)
services.power-profiles-daemon.enable = false; # Disable GNOMEs power management services.power-profiles-daemon.enable = false; # Disable GNOMEs power management
+8
View File
@@ -12,5 +12,13 @@
# taken from here # taken from here
SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0013", TAG+="uaccess" SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0013", TAG+="uaccess"
SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0018", TAG+="uaccess" SUBSYSTEMS=="usb", ATTRS{idVendor}=="32ac", ATTRS{idProduct}=="0018", TAG+="uaccess"
# acording to https://community.frame.work/t/solved-keys-stick-and-repeat-after-being-released/51153/12
# the random keypress stuck comes from conflict between powertop and udev
# fix from: https://git.gabbie.blue/blue/nixconf/src/commit/2d1bc6dad4684c019b6b3e894408e76e2734806c/hosts/gabbielaptop/configuration.nix#L68
# disable USB auto suspend for framework keyboard
ACTION=="bind", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0018", TEST=="power/control", ATTR{power/control}="on"
# disable USB auto suspend for framework macropad
ACTION=="bind", SUBSYSTEM=="usb", ATTR{idVendor}=="32ac", ATTR{idProduct}=="0013", TEST=="power/control", ATTR{power/control}="on"
''; '';
} }