Skip to content
This repository was archived by the owner on Oct 25, 2025. It is now read-only.

Commit c8708b1

Browse files
committed
Comitted main file
1 parent d2fda3e commit c8708b1

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

powermodes.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/bash
2+
# This script is made to easily switch between performance and power economy modes with the terminal.
3+
# Creator: Hellerlight
4+
### Main code
5+
powermode() {
6+
echo "Select your desired mode"
7+
echo " "
8+
echo "pwrs"
9+
echo "perf"
10+
read powermode
11+
if [ $powermode = "pwrs" ]; then
12+
echo "Changing to power saving mode"
13+
for i in 0 1 2 3 4 5 6 7
14+
do
15+
echo "core $i: "
16+
echo powersave > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor
17+
cat /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor
18+
done
19+
elif [ $powermode = "perf" ]; then
20+
echo "Changing to performance mode"
21+
for i in 0 1 2 3 4 5 6 7
22+
do
23+
echo "core $i: "
24+
echo performance > /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor
25+
cat /sys/devices/system/cpu/cpu$i/cpufreq/scaling_governor
26+
done
27+
else
28+
echo "wrong input"
29+
fi
30+
}
31+
powermode

0 commit comments

Comments
 (0)