#!/bin/sh # time in milliseconds before USB mouse will need a click to awake # is configurable in /etc/sysconfig/powertop which is sourced by systemd if [ -z "$USBDELAY" ]; then USBDELAY=180000 fi # activate all energy savings /usr/sbin/powertop --auto-tune # USB mouse will autosuspend if they were plug when powertop was launched # follow a setting to wait USBDELAY instead of 2000 by default for i in /sys/bus/usb/devices/* do if [ -f $i/idProduct ];then PRODUCT=$(cat $i/idProduct) echo $USBDELAY > $i/power/autosuspend_delay_ms echo Setting suspend delay to $USBDELAY ms for "$PRODUCT" fi done