You are not logged in.
Pages: 1
Hi,
I would like to create a simple bash script that I can bind to a Fn launch button on my laptop.
As of now, I have created two bash scripts.
performance.sh
and
powersave.sh
performance.sh
echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo -n 0 > /sys/devices/system/cpu/intel_pstate/no_turbo
powersave.sh
echo "powersave" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
echo -n 1 > /sys/devices/system/cpu/intel_pstate/no_turbo
I would like to have a script that toggles between these two scripts, that I can bind to a button, to control power savings on my laptop through a single button rather than binding aliases in my .bashrc.
I have no clue on how to do this..
If somebody has the time to help me out, I would greatly appreciate it!
Last edited by sPHERE (2013-09-02 16:47:23)
Offline
I use this to switch between powersave and ondemand
#! /bin/bash
GOV=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`
case $GOV in
"ondemand")
sudo cpupower --cpu all frequency-set -g powersave > /dev/null
;;
"powersave")
sudo cpupower --cpu all frequency-set -g ondemand > /dev/null
;;
*)
sudo cpupower --cpu all frequency-set -g powersave > /dev/null
;;
esac
GOV=`cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor`
echo "governor set to $GOV"Check the path for the cat command and change the executed commands to your liking.
Last edited by cookies (2013-08-31 17:37:52)
Offline
Worked perfectly! Thanks alot! SOLVED!
Offline
I'm delighted to hear that. Please remember to mark this thread as solved.
Offline
Pages: 1