#!/bin/sh
if on_ac_power ; then
cpufreq-set -r -g performance
# notify-send "[X] AC: Running in performance"
else
cpufreq-set -r -g powersave
# notify-send "[ ] AC: Running in powersave"
fi
To install it:
sudo install 99-cpu /etc/pm/power.d
Next, to set the default cpu governor for your linux setup, simply edit /etc/default/cpufrequtils, and add:
ENABLE="true"
GOVERNOR="performance"
MAX_SPEED="0"
MIN_SPEED="0"