From ed4bc8905d8beb94086112881ebb940e481b2f7d Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Mon, 28 Oct 2024 16:15:30 +0900 Subject: [PATCH] Enable wakeup for USB input devices which connected via USB Switcher/KVM (#896) Fixes GH-894 --- nixos/hosts/algae/default.nix | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/nixos/hosts/algae/default.nix b/nixos/hosts/algae/default.nix index e8345cf0..54f5c417 100644 --- a/nixos/hosts/algae/default.nix +++ b/nixos/hosts/algae/default.nix @@ -1,4 +1,4 @@ -{ ... }: +{ lib, ... }: { networking.hostName = "algae"; @@ -21,4 +21,20 @@ }; services.xserver.videoDrivers = [ "amdgpu" ]; + + # Required to reboot if you want to apply changes + # Prevent GH-894 + # https://askubuntu.com/a/1446653 + services.udev.extraRules = lib.mkAfter '' + # Enable USB port 3 wakeup + ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="2109", ATTRS{idProduct}=="2817", ATTRS{busnum}=="3", ATTR{power/wakeup}="enabled" + # Disable USB Switcher wakeup + ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="5411", ATTR{power/wakeup}="disabled" + # Enable trackball - "Kensington SlimBlade Pro Trackball(Wired)" wakeup + ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="047d", ATTRS{idProduct}=="80d7", ATTR{power/wakeup}="enabled" + # Enable keyboard - "REALFORCE 87 US" wakeup + ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="0853", ATTRS{idProduct}=="0146", ATTR{power/wakeup}="enabled" + # Enable keyboard - "ThinkPad Compact USB Keyboard with TrackPoint" wakeup + ACTION=="add", SUBSYSTEM=="usb", DRIVERS=="usb", ATTRS{idVendor}=="17ef", ATTRS{idProduct}=="6047", ATTR{power/wakeup}="enabled" + ''; }