# External mouse and keyboard sleep when they stay untouched for a few seconds

**URL:** https://discourse.nixos.org/t/external-mouse-and-keyboard-sleep-when-they-stay-untouched-for-a-few-seconds/14900
**Category:** Help
**Created:** [September 7, 2021, 7:45am UTC](https://discourse.nixos.org/t/external-mouse-and-keyboard-sleep-when-they-stay-untouched-for-a-few-seconds/14900 "2021-09-07T07:45:19Z")
**Posts on this page:** 1
**Showing post:** 9

<div class="post-metadata">

### Author: ![eigengrau](https://discourse.nixos.org/user_avatar/discourse.nixos.org/eigengrau/32/7611_2.png) [@eigengrau](https://discourse.nixos.org/u/eigengrau)
#### Post date: [September 15, 2021, 11:10am UTC](https://discourse.nixos.org/t/external-mouse-and-keyboard-sleep-when-they-stay-untouched-for-a-few-seconds/14900/9 "2021-09-15T11:10:54Z")

</div>

Just a shot in the dark, but in the past, when I had similar issues, it turned out that the Linux kernel’s USB autosuspend feature was involved and the devices apparently could not properly handle the autosuspend.

You can search directories under `/sys/bus/usb/devices` for your affected USB devices. Subsequently, you could check the contents of a file named `power/control` stored in the respective directory. The file may contain the string `auto`, which instructs the kernel to use USB autosuspend when the devices are not in use. You can then manually disable auto-suspend by writing `on` to these files instead, as in: `echo on | sudo tee /sys/bus/usb/devices/…/power/control`.

When your problem no longer occurs after disabling USB autosuspend, you could configure things so that in the future, USB autosuspend will be automatically disabled for these devices. E.g., see [Power management - ArchWiki](https://wiki.archlinux.org/title/Power_management#USB_autosuspend) or compare the NixOS documentation on setting up udev rules.

---

_[View the full topic](https://discourse.nixos.org/t/external-mouse-and-keyboard-sleep-when-they-stay-untouched-for-a-few-seconds/14900)._
