Bitcoin donations are welcome:14snQXeLcnJtWUduKZ6rC2MHdPYrYar1Tw

Friday, June 15, 2012

Automaticly set cpu governor when cable gets connected or disconnected

Edit 99-cpu, and add:

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