[解决]帮忙贴个conky的温度监视的配置
时间:2007-08-13
来源:互联网
CPU:$color ${i2c 9191-0290 temp 2}C${color grey} - MB:$color ${i2c 9191-0290 temp 1}C |
/sys/devices/pci0000:00/0000:00:18.3/temp1_input /sys/devices/platform/w83627hf.656/temp3_type /sys/devices/platform/w83627hf.656/temp3_max_hyst /sys/devices/platform/w83627hf.656/temp3_max /sys/devices/platform/w83627hf.656/temp3_input /sys/devices/platform/w83627hf.656/temp2_type /sys/devices/platform/w83627hf.656/temp2_max_hyst /sys/devices/platform/w83627hf.656/temp2_max /sys/devices/platform/w83627hf.656/temp2_input /sys/devices/platform/w83627hf.656/temp1_type /sys/devices/platform/w83627hf.656/temp1_max_hyst /sys/devices/platform/w83627hf.656/temp1_max /sys/devices/platform/w83627hf.656/temp1_input |
作者: blackwhite 发布时间: 2007-08-13
/sys/devices/pci0000:00/0000:00:18.3/temp1_input
/sys/devices/platform/w83627hf.656/temp3_type
/sys/devices/platform/w83627hf.656/temp3_max_hyst
/sys/devices/platform/w83627hf.656/temp3_max
screenshot.png (35.8 KB, 23 次查看) | |
screenshot1.png (103.0 KB, 15 次查看) |
作者: nainaide 发布时间: 2007-08-13
作者: 三翻领 发布时间: 2007-08-13
cpu1 ${exec echo $(cat /sys/class/hwmon/hwmon1/device/temp1_input) / 1000 | bc}°C
风扇转速$alignr${exec echo $(cat /proc/acpi/ibm/fan |grep -Po [0-9+])} /分钟
电池:${exec battery_charge.pl}$alignr${exec battery_check.pl}
${execbar (exec battery_check.pl)}
电池状态的文件内容稍微复杂,我写了一个小perl程序, 放到了 /usr/bin/中
@localhost ~ $ cat /usr/bin/battery_charge.pl
#!/usr/bin/perl
#test mode match
$state_battery = undef;
open STATE, " <", "/proc/acpi/battery/BAT0/state";
while (<STATE>) {
chomp;
if (/charging state:\s+(.*)/) {
$state_battery = $1;
last;
}
}
print "$state_battery";
@localhost ~ $ cat /usr/bin/battery_check.pl
#!/usr/bin/perl
#test mode match
#
$remaining_capacity = undef;
$total_capacity = undef;
open STATE, " <", "/proc/acpi/battery/BAT0/state";
while (<STATE>) {
chomp;
if (/remaining capacity:\s+(\d+)/) {
$remaining_capacity = $1;
}
}
open INFO, " <", "/proc/acpi/battery/BAT0/info";
while (<INFO>) {
chomp;
if (/design capacity:\s+(\d+)/) {
$total_capacity = $1;
}
}
if ($total_capacity == 0) {
print "没有安装电池";
} else {
printf "%2.2f %", $remaining_capacity/$total_capacity*100;
}
作者: nainaide 发布时间: 2007-08-13
作者: blackwhite 发布时间: 2007-08-13
作者: 三翻领 发布时间: 2007-08-13
作者: 三翻领
我也是i2c,cat就行了?
|
追加问个问题,怎么那个°C,在我的conky里边显示不正常?是不是我用字体里边没有这个字符造成的?
作者: blackwhite 发布时间: 2007-08-14
作者: nainaide 发布时间: 2007-08-14
作者: nainaide
可能,我用的是STHeiti。
|
作者: blackwhite 发布时间: 2007-08-14
作者: blackwhite
我用了这个字体,也不行,怪了。果真是因为我的LC_CTYPE=zh_CN的缘故。如果用LC_CTYPE=zh_CN.UTF-8就好了。
|
@localhost ~ $ locale
LANG=en_US.utf8
LC_CTYPE=zh_CN.utf8
LC_NUMERIC="en_US.utf8"
LC_TIME="en_US.utf8"
LC_COLLATE="en_US.utf8"
LC_MONETARY="en_US.utf8"
LC_MESSAGES="en_US.utf8"
LC_PAPER="en_US.utf8"
LC_NAME="en_US.utf8"
LC_ADDRESS="en_US.utf8"
LC_TELEPHONE="en_US.utf8"
LC_MEASUREMENT="en_US.utf8"
LC_IDENTIFICATION="en_US.utf8"
LC_ALL=
作者: nainaide 发布时间: 2007-08-14
frank@localhost ~ $ cd /proc/acpi/fan/
frank@localhost /proc/acpi/fan $ ls
FAN
frank@localhost /proc/acpi/fan $ cd FAN/
frank@localhost /proc/acpi/fan/FAN $ ls
state
frank@localhost /proc/acpi/fan/FAN $ cat state
status: on
作者: 三翻领 发布时间: 2007-08-15
作者: 三翻领
可能是台机的原因或者是哪里的问题,貌似我这里用cat现实cpu转速不行
frank@localhost ~ $ cd /proc/acpi/fan/ frank@localhost /proc/acpi/fan $ ls FAN frank@localhost /proc/acpi/fan $ cd FAN/ frank@localhost /proc/acpi/fan/FAN $ ls state frank@localhost /proc/acpi/fan/FAN $ cat state status: on |
cat /sys/class/hwmon/hwmon0/device/fan1_input 如果没有检查一下 kernel config有没有CONFIG_ACPI_FAN=y
作者: nainaide 发布时间: 2007-08-15
作者: nainaide
这是我显示CPU\风扇\电池的配置
cpu1 ${exec echo $(cat /sys/class/hwmon/hwmon1/device/temp1_input) / 1000 | bc}°C 风扇转速$alignr${exec echo $(cat /proc/acpi/ibm/fan |grep -Po [0-9+])} /分钟 |
ibm_fan --- If running the IBM ACPI, displays the fan speed.
ibm_temps N --- If running the IBM ACPI, displays the temperatures from the IBM temperature sensors (N=0..7) Sensor 0 is on the CPU, 3 is on the GPU.
作者: zhou3345 发布时间: 2007-08-16
作者: zhou3345
我用了你的设置,挺好的。刚看了一下官方说明,发现ibm还可以用变量查看。你的风扇里写着有ibm,估摸着对你也有用。变量如下:
ibm_fan --- If running the IBM ACPI, displays the fan speed. ibm_temps N --- If running the IBM ACPI, displays the temperatures from the IBM temperature sensors (N=0..7) Sensor 0 is on the CPU, 3 is on the GPU. |
作者: nainaide 发布时间: 2007-08-16
作者: nainaide
去这个地方看看:
cat /sys/class/hwmon/hwmon0/device/fan1_input 如果没有检查一下 kernel config有没有CONFIG_ACPI_FAN=y |
请教temp1_input和temp2_input分别指哪个温度,尽管从经验上看temp2_input是cpu温度
作者: 三翻领 发布时间: 2007-08-16
作者: 三翻领
多谢多谢,有救了
请教temp1_input和temp2_input分别指哪个温度,尽管从经验上看temp2_input是cpu温度 |
比如,
(http://www.thinkwiki.org/wiki/Thermal_Sensors)
ThinkPad R51
The ibm-acpi documentation includes the report by Thomas Gruber:
EC offset Index in "thermal" Location (estimated)
0x78 1 CPU
0x79 2 Mini-PCI
0x7A 3 HDD
0x7B 4 GPU
0x7C 5 System battery
0x7D 6 UltraBay battery
0x7E 7 System battery
0x7F 8 UltraBay battery
0xC0 none ?
0xC1 none ?
0xC2 none ?
[edit] ThinkPad T40
The location of one of the sensors is identified here.
EC offset Index in "thermal" Location (estimated)
0x78 1 CPU
0x79 2 System board under rear left corner of Mini-PCI module
0x7A 3 ?
0x7B 4 GPU
0x7C 5 Battery
0x7D 6 n/a
0x7E 7 Battery
0x7F 8 n/a
0xC0 none n/a
0xC1 none n/a
0xC2 none n/a
[edit] ThinkPad T43, T43p
Found by Shmidoax using cooling spray to cool down components and observe the effect on the sensors.
EC offset Index in "thermal" Location (estimated)
0x78 1 CPU
0x79 2 Between PCMCIA slot and CPU (same as HDAPS module)
0x7A 3 PCMCIA slot
0x7B 4 GPU
0x7C 5 System battery (front left = charging circuit)
0x7D 6 UltraBay battery?
0x7E 7 System battery (rear right)
0x7F 8 UltraBay battery?
0xC0 none Bus between Northbridge and DRAM
0xC1 none Southbridge, WLAN and clock generator (under Mini-PCI card, under touchpad)
0xC2 none Power circuitry, on underside of system board under F2 key
作者: nainaide 发布时间: 2007-08-16
热门阅读
-
office 2019专业增强版最新2021版激活秘钥/序列号/激活码推荐 附激活工具
阅读:74
-
如何安装mysql8.0
阅读:31
-
Word快速设置标题样式步骤详解
阅读:28
-
20+道必知必会的Vue面试题(附答案解析)
阅读:37
-
HTML如何制作表单
阅读:22
-
百词斩可以改天数吗?当然可以,4个步骤轻松修改天数!
阅读:31
-
ET文件格式和XLS格式文件之间如何转化?
阅读:24
-
react和vue的区别及优缺点是什么
阅读:121
-
支付宝人脸识别如何关闭?
阅读:21
-
腾讯微云怎么修改照片或视频备份路径?
阅读:28