Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Control the fan speed of the Macbook Air
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}
# 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
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
You can’t perform that action at this time.