Sophie

Sophie

distrib > Mageia > 6 > armv7hl > media > core-updates-src > by-pkgid > bbb44c3b38846112dec73c088b54a9ef > files > 5

powertop-2.9-6.mga6.src.rpm

#!/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