Thinkpad T420

aptitude install sysfsutils tp-smapi-dkms hdapsd firmware-iwlwifi
echo thinkpad_acpi >> /etc/modules
echo tp_smapi >> /etc/modules

Battery charging thresholds

vim /etc/sysfs.conf
# For a LiIon battery in a Thinkpad
devices/platform/smapi/BAT0/start_charge_thresh = 20
devices/platform/smapi/BAT0/stop_charge_thresh = 80

Brightness on boot

vim /etc/sysfs.conf
# Brightness (0 to 15)
class/backlight/acpi_video0/brightness = 6

Fan control (thinkfan)

aptitude install lm-sensors thinkfan
sensors-detect

Edit /etc/thinkfan.conf:

vim /etc/thinkfan.conf
# Default thinkfan.conf config
(0, 0,  55)
(1, 48, 60)
(2, 50, 61)
(3, 52, 63)
(4, 56, 65)
(5, 59, 66)
(7, 63, 32767)

# Sensors
sensor /sys/devices/platform/coretemp.0/temp1_input (0)
sensor /sys/devices/platform/coretemp.0/temp2_input (0)
sensor /sys/devices/platform/coretemp.0/temp3_input (0)
sensor /sys/devices/virtual/hwmon/hwmon0/temp1_input (0)

# Config 1
#(0, 0, 35)
#(1, 33, 38)
#(2, 36, 45)
#(3, 39, 49)
#(4, 46, 58)
#(5, 50, 62)
#(7, 56, 32767)

# Config 2
#(0, 0, 52)
#(1, 46, 59)
#(2, 54, 65)
#(3, 58, 69)
#(4, 62, 72)
#(5, 65, 74)
#(7, 68, 32767)
echo "options thinkpad_acpi fan_control=1" >> /etc/modprobe.d/thinkfan.conf

Edit /etc/default/thinkfan:

vim /etc/default/thinkfan
[...]
START=yes
[...]

Links