From b5593ec19bf693c55e35f88bbce7b45a1381d986 Mon Sep 17 00:00:00 2001 From: Alexander Sulfrian Date: Thu, 8 Jan 2009 11:37:23 +0100 Subject: added some usefull scripts bin/Xshutdown.sh - graphical script for shutdown/reboot/standby sbin/set_governor - set the governor of both cpus sbin/keyword_package - adds a package to /etc/portage/packages.keywords sbin/asound_backup.sh - creates a backup of /etc/asound.conf sbin/asound_pulse_disable.sh - removes the default references to pulse sbin/asound_pulse_enable.sh - adds pcm.!default und ctl.!default references to pulse --- sbin/set_governor | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 sbin/set_governor (limited to 'sbin/set_governor') diff --git a/sbin/set_governor b/sbin/set_governor new file mode 100755 index 0000000..08f68e5 --- /dev/null +++ b/sbin/set_governor @@ -0,0 +1,37 @@ +#!/bin/bash +# +# Script to display and set (checked) the governors for the both CPU Cores (f.e. from the Core2Duo) +# (c) Alexander Sulfrian 2007 +# Licence: GPL v3 +# + + +if [ -z "$1" ] +then + activ_governor_cpu0=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` + activ_governor_cpu1=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor` + echo "active governors" + echo "CPU 0: ${activ_governor_cpu0}" + echo "CPU 1: ${activ_governor_cpu1}" + exit 1 +fi + + +governor_avalible=`sed 's/ \(.\)/\n\1/g;s/ $//g' /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors | grep "^${1}\$"` +if [ -z "$governor_avalible" ] +then + avalible_governors=`sed 's/ \(.\)/|\1/g;s/ $//g' /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors` + echo "Usage:" + echo "$0 [${avalible_governors}]" + exit 2 +fi + +echo "$1" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor +echo "$1" > /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor + +activ_governor_cpu0=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor` +activ_governor_cpu1=`cat /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor` +echo "active governors" +echo "CPU 0: ${activ_governor_cpu0}" +echo "CPU 1: ${activ_governor_cpu1}" +exit 0 -- cgit v1.2.3