Skip to content

Instantly share code, notes, and snippets.

@fpletz
Created March 8, 2016 19:36
Show Gist options
  • Select an option

  • Save fpletz/cf444c7ef04010b474b8 to your computer and use it in GitHub Desktop.

Select an option

Save fpletz/cf444c7ef04010b474b8 to your computer and use it in GitHub Desktop.
thinkpad fan
#!/bin/sh
PWM=/sys/devices/platform/thinkpad_hwmon/pwm1
PWM_ENABLE=/sys/devices/platform/thinkpad_hwmon/pwm1_enable
case $1 in
full)
echo "Fan: full-speed"
echo 0 > $PWM_ENABLE
;;
hw|auto)
echo "Fan: auto"
echo 2 > $PWM_ENABLE
;;
*)
echo 1 > $PWM_ENABLE
echo $1 > $PWM
echo "Fan: $(cat $PWM)"
;;
esac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment