Created
December 13, 2011 16:32
-
-
Save peterhellberg/1472799 to your computer and use it in GitHub Desktop.
Control the fan speed of the Macbook Air
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
smc=/Applications/smcFanControl.app/Contents/Resources/smc | |
min_hex=$(python -c "print hex("2000" << 2)[2:]") | |
max_hex=$(python -c "print hex("6500" << 2)[2:]") | |
${smc} -k F0Mn -w ${min_hex} | |
${smc} -k F0Mx -w ${max_hex} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Control the fan speed of the Macbook Air | |
# NOTE: Don’t complain if you melt your computer. | |
function set_fan_speed { | |
if [ -z "$1" ]; then min_speed=2000; else min_speed=$1; fi | |
if [ -z "$2" ]; then max_speed=6500; else max_speed=$2; fi | |
smc=/Applications/smcFanControl.app/Contents/Resources/smc | |
min_hex=$(python -c "print hex("$min_speed" << 2)[2:]") | |
max_hex=$(python -c "print hex("$max_speed" << 2)[2:]") | |
${smc} -k F0Mn -w ${min_hex} | |
${smc} -k F0Mx -w ${max_hex} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment