diff options
author | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2012-08-22 22:05:51 -0300 |
---|---|---|
committer | André Fabian Silva Delgado <emulatorman@lavabit.com> | 2012-08-22 22:05:51 -0300 |
commit | 6d75a98a73a4ec9ab58fb5e0da5dedc0ba094d76 (patch) | |
tree | f71d01fc49a359cb7572501b131395ab4b629604 /libre/linux-libre-tools/cpupower.pmutils | |
parent | 46af39de85b934a8f4b2d8884c575db30fb4657c (diff) | |
download | abslibre-6d75a98a73a4ec9ab58fb5e0da5dedc0ba094d76.tar.gz abslibre-6d75a98a73a4ec9ab58fb5e0da5dedc0ba094d76.tar.bz2 abslibre-6d75a98a73a4ec9ab58fb5e0da5dedc0ba094d76.zip |
linux-libre-tools-3.5-4: updating revision (add pm-utils powersave hook)
Diffstat (limited to 'libre/linux-libre-tools/cpupower.pmutils')
-rw-r--r-- | libre/linux-libre-tools/cpupower.pmutils | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/libre/linux-libre-tools/cpupower.pmutils b/libre/linux-libre-tools/cpupower.pmutils new file mode 100644 index 000000000..fb93cd7c1 --- /dev/null +++ b/libre/linux-libre-tools/cpupower.pmutils @@ -0,0 +1,37 @@ +#!/bin/bash + +[[ -x /usr/bin/cpupower ]] || exit $NA + +CPUPOWER_GOVERNOR_AC=${CPUPOWER_GOVERNOR_AC:-ondemand} +CPUPOWER_GOVERNOR_BAT=${CPUPOWER_GOVERNOR_BAT:-conservative} + +help() { + cat <<EOF +-------- +$0: Select cpupower frequency governor. + +Parameters: +CPUPOWER_GOVERNOR_AC = Governor to use on AC. +Defaults to ondemand. + +CPUPOWER_GOVERNOR_BAT = Governor to use on battery. +Defaults to conservative. + +EOF +} + +cpupow() { + printf 'Setting cpupower frequency governor to %s...' "$1" + cpupower -c all frequency-set -g "$1" +} + +case $1 in + true) cpupow "$CPUPOWER_GOVERNOR_BAT" ;; + false) cpupow "$CPUPOWER_GOVERNOR_AC" ;; + help) help;; + *) exit $NA ;; +esac + +exit 0 + +# vim:set ts=2 sw=2 ft=sh et: |