summaryrefslogtreecommitdiff
path: root/.local/bin/intel-turbo.sh
blob: 57836e0c74e8246993b5d4bb97a4159bff181711 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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