summaryrefslogtreecommitdiff
path: root/.local/bin/intel-turbo.sh
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/intel-turbo.sh')
-rwxr-xr-x.local/bin/intel-turbo.sh30
1 files changed, 30 insertions, 0 deletions
diff --git a/.local/bin/intel-turbo.sh b/.local/bin/intel-turbo.sh
new file mode 100755
index 0000000..57836e0
--- /dev/null
+++ b/.local/bin/intel-turbo.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+bold=$(tput bold)
+red=$(tput setaf 1)
+green=$(tput setaf 2)
+reset=$(tput sgr0)
+syspath="/sys/devices/system/cpu/intel_pstate/no_turbo"
+
+case "$1" in
+ on)
+ echo 0 > $syspath
+ ;;
+
+ off)
+ echo 1 > $syspath
+ ;;
+
+ *)
+ echo "Usage: $0 on|off"
+ echo
+ echo -n "Current turbo status: "
+
+ status=$(cat $syspath)
+ if [ "$status" = "0" ]; then
+ echo "${bold}${green}enabled${reset}"
+ else
+ echo "${bold}${red}disabled${reset}"
+ fi
+ ;;
+esac