1 # Contributor: Thomas Mudrunka <harvie@@email..cz>
2 # You can also contact me on http://blog.harvie.cz/
5 # - sdparm + hdparm support
7 pkgname=laptop-init-script
10 pkgdesc="Small rc.d script for enabling/disabling cpufrequtils, pm-utils, laptop-mode-tools and hdparm optimalizations from init (rc.conf)"
13 url="http://wiki.archlinux.org/index.php/Laptop-init-script"
14 depends=('cpufrequtils' 'pm-utils' 'laptop-mode-tools' 'hdparm' 'sdparm')
17 mkdir -p ${pkgdir}/etc/rc.d
19 cat > ${pkgdir}/etc/rc.d/laptop-init <<"EOF"
21 #universal daemon controller
27 cpus=$(sed -ne 's/^processor.* \([0-9]\+\)$/\1/p' /proc/cpuinfo)
30 cpufreq-set -c $cpu -g $1
36 stat_busy "Enabling cpufreq CPU scaling"
37 #cpufreq-set-all conservative #less dynamic (saving more power, but slooooow)
38 cpufreq-set-all ondemand #more dynamic (saving power, when speed is not needed)
40 stat_busy "Entering laptop mode"
41 echo 1 > /proc/sys/vm/laptop_mode
43 stat_busy "Launching pm-powersave true"
48 stat_busy "Disabling cpufreq CPU scaling"
49 cpufreq-set-all performance
51 stat_busy "Leaving laptop mode"
52 echo 0 > /proc/sys/vm/laptop_mode
54 stat_busy "Launching pm-powersave false"
64 echo "usage: $0 {start|stop|restart}"
69 chmod -R 755 ${pkgdir}/