diff options
author | Evgeny Sorokin <me@ch1p.io> | 2024-01-06 03:41:49 +0000 |
---|---|---|
committer | Evgeny Sorokin <me@ch1p.io> | 2024-01-06 03:41:49 +0000 |
commit | 6e5d672ea04fb8c89ce9e91cf4c9a53fbb8c2f81 (patch) | |
tree | d9f9200cf572385cf25f41442231675d5eeabcb8 /.local/bin/intel-turbo.sh |
Diffstat (limited to '.local/bin/intel-turbo.sh')
-rwxr-xr-x | .local/bin/intel-turbo.sh | 30 |
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 |