ToxicCode     =Home= / =Config Files= / =Shell Scripts= / =Articles= / =Text Files= / =Misc= /

Register | Login | Submit new shell script

Title: Scaling
Submitted by: Fingel on 2009-03-16
Function: Set CPU scaling governor

#!/bin/bash
#originally by stojic from http://bbs.archlinux.org/viewtopic.php?id=56646
#Sets the cpu scaling governor.
#Requires that /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
#be writeable by the person using the script
###
if test "$1" = "get"
then
        cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
elif test "$1" = "set"
then
        if test "$2" = "powersave" || test "$2" = "conservative" || \
                test "$2" = "ondemand" || test "$2" = "performance"
        then
                echo -n "$2" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
        else
                echo "Unknown governor."
        fi
else
        echo "Usage:"
        echo "  $(basename $0) get"
        echo "  $(basename $0) set powersave|conservative|ondemand|performance"
fi



Comments

Fingel
2009-03-16
Essential for laptop users




Nothing Copyrighted