这里假定,你已经按照ArchWiki安装并配置好了ArchLinux,并且有一个可用的桌面环境,下面将以Gnome桌面环境为例。
1、为Thinkpad准备好内核模块
软件包:tp_smapi (AUR)
需要修改代码,在hdaps.c的
代码: 全选
HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X61", HDAPS_ORIENT_SWAP | HDAPS_ORIENT_INVERT_X),
代码: 全选
HDAPS_DMI_MATCH_INVERT("LENOVO", "ThinkPad X200", HDAPS_ORIENT_SWAP | HDAPS_ORIENT_INVERT_X | HDAPS_ORIENT_INVERT_Y),
代码: 全选
HDAPS=true make ......
并运行depmod -a
2、配置内核模块。
a、打开风扇控制。在/etc/modprobe.d/modprobe.conf 中加入一行:
代码: 全选
options thinkpad_acpi fan_control=1
代码: 全选
options snd-hda-intel model=lenovo-x200 enable_msi=1
噪音是风扇等的噪音,求实时消噪的录音软件!
c、自动加载的内核模块:tp_smapi、hdaps、acpi-cpufreq
3、传感器,温度监控。
软件包:lm_sensors、sensors-applet (gnome_applet)、hddtemp
将hddtemp加入到daemon中去,让其自动启动,运行一次sensors-detect来发现传感器。将sensors-applet添加到面板,监控温度。
4、风扇控制。
软件包:tpfand(AUR)、tpfan-admin(AUR)(年久失修,估计不能用了)
将tpfand加入到daemon中让其自动启动,如果tpfan-admin不能用可以自己手写一份配置,或者安装:tpfand-profiles(AUR)
另:tpfand的正常运行依赖hal,但现在ArchLinux使用的是Xorg1.8,如果仅仅为tpfand启动hal真是划不来。修改tpfand的代码吧。tpfand只在settings.py中使用了HAL的功能,也仅仅是为了获取一些名字而已,因为tpfand只是自己用,不需要考虑可以移植,完全可以写死这些名字,而不用从HAL中取得。
于是,将settings.py中的:
代码: 全选
def read_model_info(self):
"""reads model info from HAL"""
try:
bus = dbus.SystemBus()
computer_obj = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/devices/computer')
computer = dbus.Interface(computer_obj, 'org.freedesktop.Hal.Device')
product_id = computer.GetProperty('system.hardware.vendor') + "_" + computer.GetProperty('system.hardware.product')
self.product_id = product_id.lower()
product_name = computer.GetProperty('system.hardware.vendor') + "_" + computer.GetProperty('system.hardware.version')
self.product_name = product_name.lower().replace('/', '-').replace(' ', '_')
self.product_pretty_vendor = computer.GetProperty('system.hardware.vendor')
self.product_pretty_name = computer.GetProperty('system.hardware.version')
self.product_pretty_id = computer.GetProperty('system.hardware.product')
except:
print "Warning: unable to get your system model from HAL."
self.product_id = None
self.product_name = None
self.product_pretty_vendor = None
self.product_pretty_name = None
self.product_pretty_id = None
代码: 全选
# try:
# bus = dbus.SystemBus()
# computer_obj = bus.get_object('org.freedesktop.Hal', '/org/freedesktop/Hal/devices/computer')
# computer = dbus.Interface(computer_obj, 'org.freedesktop.Hal.Device')
# product_id = computer.GetProperty('system.hardware.vendor') + "_" + computer.GetProperty('system.hardware.product')
# self.product_id = product_id.lower()
# product_name = computer.GetProperty('system.hardware.vendor') + "_" + computer.GetProperty('system.hardware.version')
# self.product_name = product_name.lower().replace('/', '-').replace(' ', '_')
# self.product_pretty_vendor = computer.GetProperty('system.hardware.vendor')
# self.product_pretty_name = computer.GetProperty('system.hardware.version')
# self.product_pretty_id = computer.GetProperty('system.hardware.product')
# except:
# print "Warning: unable to get your system model from HAL."
self.product_id = u'LENOVO_74574AC'
self.product_name = u'LENOVO_ThinkPad X200'
self.product_pretty_vendor = dbus.String(u'LENOVO')
self.product_pretty_name = dbus.String(u'ThinkPad X200')
self.product_pretty_id = dbus.String(u'74574AC')
5、中键模拟
新建文件:/etc/X11/xorg.conf.d/10-wheel-emulation.conf
写入:
代码: 全选
# Accelerometer device, posts data through ABS_X/ABS_Y, making X unusable
# http://bugs.freedesktop.org/show_bug.cgi?id=22442
Section "InputClass"
Identifier "Trackpoint Wheel Emulation"
MatchProduct "TPPS/2 IBM TrackPoint|DualPoint Stick|Synaptics Inc. Composite TouchPad / TrackPoint|ThinkPad USB Keyboard with TrackPoint|USB Trackpoint pointing device"
MatchDevicePath "/dev/input/event*"
Option "EmulateWheel" "true
Option "EmulateWheelButton" "2"
Option "Emulate3Buttons" "false"
Option "XAxisMapping" "6 7"
Option "YAxisMapping" "4 5"
EndSection
软件包:hdapsd(AUR)、hdaps-gl(AUR)、thinkhdaps(AUR)
将hdapsd加入到daemon中去,thinkhdaps加入到启动中。
7、笔记本模式。
软件包:laptop-mode-tools
将laptop-mode加入到daemon中,修改/etc/laptop-mode/laptop-mode.conf把ENABLE_AUTO_MODULES的值改成1
8、保护电池
电池的充放次数有限,所以,尽量使其不充电为好,而默认的设置不是个很好的设置。
新建文件:/etc/sysfs.conf,写入下面内容:
代码: 全选
# Make battery live longer
devices/platform/smapi/BAT0/start_charge_thresh = 50
devices/platform/smapi/BAT0/stop_charge_thresh = 90
代码: 全选
# Make battery live longer
devices/platform/smapi/BAT0/start_charge_thresh = 10
devices/platform/smapi/BAT0/stop_charge_thresh = 100
新建文件:/etc/rc.d/sysfsutils,写入下面内容:
代码: 全选
#! /bin/sh -e
### BEGIN INIT INFO
# Provides: sysfsconf
# Required-Start: mountkernfs
# Should-Start: udev module-init-tools loadcpufreq
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop:
# Short-Description: Set sysfs variables from /etc/sysfs.conf
# Description: Similarly to /etc/init.d/procps.sh, you can configure
# values for sysfs variables (such as power management
# defaults) and /sys file permissions in /etc/sysfs.conf.
### END INIT INFO
# /etc/init.d/sysfsutils:
#
# (c) 2005 Martin Pitt <mpitt@debian.org>
CONFFILE=/etc/sysfs.conf
[ -r "$CONFFILE" ] || exit 0
. /etc/rc.conf
. /etc/rc.d/functions
case "$1" in
start)
stat_busy "Setting sysfs variables..."
sed 's/#.*$//; /^[[:space:]]*$/d;
s/^[[:space:]]*\([^=[:space:]]*\)[[:space:]]*\([^=[:space:]]*\)[[:space:]]*=[[:space:]]*\(.*\)/\1 \2 \3/' \
$CONFFILE | {
while read f1 f2 f3; do
if [ "$f1" = "mode" -a -n "$f2" -a -n "$f3" ]; then
if [ -f "/sys/$f2" ]; then
chmod "$f3" "/sys/$f2"
else
stat_fail
fi
elif [ "$f1" = "owner" -a -n "$f2" -a -n "$f3" ]; then
if [ -f "/sys/$f2" ]; then
chown "$f3" "/sys/$f2"
else
stat_fail
fi
elif [ "$f1" -a -n "$f2" -a -z "$f3" ]; then
if [ -f "/sys/$f1" ]; then
# Some fields need a terminating newline, others
# need the terminating newline to be absent :-(
echo -n "$f2" > "/sys/$f1" 2>/dev/null ||
echo "$f2" > "/sys/$f1"
else
stat_fail
fi
else
stat_fail
exit 1
fi
done
}
stat_done
;;
stop)
;;
*)
echo "Usage: /etc/init.d/sysfsutils {start|stop|force-reload|restart}"
exit 1
;;
esac
代码: 全选
chmod +x /etc/rc.d/sysfsutils
9、我自己使用的各种配置文件。
a、rc.conf
代码: 全选
MODULES=(!snd_pcm_oss !snd_mixer_oss !snd_seq_oss !thinkpad_ec tp_smapi hdaps acpi-cpufreq)
DAEMONS=(syslog-ng dbus acpid hdapsd tpfand networkmanager hddtemp alsa laptop-mode sysfsutils)
代码: 全选
enabled = True
override_profile = True
0. CPU = 0:0 45:3 60:6
1. Mini PCI = 0:0 50:3
2. Sensor 2 = 0:255
3. GPU = 0:0 50:3
4. Bat0 = 0:0 35:2
5. Sensor 5 = 0:255
6. Bat1 = 0:0 35:2
7. Sensor 7 = 0:255
8. MB? = 0:0 45:2 60:4
9. MB? = 0:0 55:3
10. Sensor 10 = 0:255
11. Sensor 11 = 0:255
12. Sensor 12 = 0:255
13. Sensor 13 = 0:255
14. Sensor 14 = 0:255
15. Sensor 15 = 0:255
hysteresis = 2
interval_speed = 2
interval_duration = 500.000000
interval_delay = 5000.000000
另外,标记为AUR的软件包,尽量用yaourt安装。
由于风扇控制造成的计算机损坏,本人概不负责。