ToxicCode =Home= / =Config Files= / =Shell Scripts= / =Articles= / =Text Files= / =Misc= /
Register | Login | Submit new shell script#!/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"
fiEssential for laptop users