您的位置:首页 > 其它

终于搞定了conky

2008-10-25 14:49 260 查看
从网上找到的配置例子都有点问题,大多数都是用的i2c,可是新版本的sensors都在platform里了。

首先安装需要的程序:
sudo apt-get install lm-sensors conky
配置sensors:
sudo sensors-detect
一路回车,在最后显示出来需要加载的模块,比如我的:To load everything that is needed, add this to /etc/modules:

#----cut here----
# Chip drivers
f71805f
k8temp
#----cut here----

Do you want to add these lines automatically? (yes/NO)
这里要注意,如果想要每次启动自动加载驱动模块的话就要回答 yes,而默认的是no
手动加载这检测到的驱动模块:
sudo modprobe f71805f
sudo modprobe k8temp
运行sensors看看结果:$ sensors
k8temp-pci-00c3
Adapter: PCI adapter
Core0 Temp: +30.0°C

f71872f-isa-0290
Adapter: ISA adapter
in0: +3.36 V (min = +0.00 V, max = +4.03 V)
in1: +0.98 V (min = +0.00 V, max = +2.02 V)
in2: +1.26 V (min = +0.00 V, max = +2.02 V)
in3: +0.95 V (min = +0.00 V, max = +2.02 V)
in5: +1.10 V (min = +0.00 V, max = +2.02 V)
in6: +1.55 V (min = +0.00 V, max = +2.02 V)
in7: +1.42 V (min = +0.00 V, max = +0.00 V) ALARM
in9: +3.36 V (min = +0.00 V, max = +4.03 V)
in10: +3.10 V (min = +0.00 V, max = +4.03 V)
fan1: 2311 RPM (min = 0 RPM)
fan2: 0 RPM (min = 0 RPM)
fan3: 0 RPM (min = 0 RPM)
temp1: +29.0°C (high = +100.0°C, hyst = +100.0°C) sensor = thermal diode
temp2: +27.0°C (high = +255.0°C, hyst = +0.0°C) sensor = thermal diode
temp3: +96.0°C (high = +114.0°C, hyst = +24.0°C) sensor = thermistor

准备工作完成,下面就是配置conky了,安装完conky是不会自动生成配置文件的,所以要手动新建一个文件:
vi ~/.conkyrc#Conky configuration
background yes
use_xft yes
xftfont Monospace:size=9
xftalpha 0.8
out_to_console no
update_interval 2
total_run_times 0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders yes
stippled_borders 5
maximum_width 222
border_margin 4
border_width 1
default_color grey
default_shade_color black
default_outline_color black
alignment top_right
gap_x 10
gap_y 47
no_buffers no
uppercase no
cpu_avg_samples 2
net_avg_samples 2
override_utf8_locale yes
use_spacer no

TEXT
${color white}$alignc$sysname $kernel on $machine
${color white}${exec whoami} @ $nodename $alignr Uptime: ${color white}$uptime
$color$stippled_hr
${color}Date: ${color white}${time %Y,%m,%d}${alignr}${color}Time: ${color white}${time %k:%M:%S}
$color$stippled_hr
CPU ${color FFFFFF}${alignc} ${freq dyn}MHz / ${platform f71805f.656 temp 2}°C ${alignc} MB: ${color white}${platform f71805f.656 temp 1}°C
${color}CPU:${color white} ${cpu cpu1}% ${cpubar cpu1}
${cpugraph 000000 5000a0}
${color}RAM:${color white}$memperc% $mem/$memmax $membar
${color}Swap:${color white}$swapperc% $swap/$swapmax ${swapbar}
$color$stippled_hr
${alignc}File systems
${color}/dev/sda1${color white} ${fs_used_perc /}% ${fs_used /}/${fs_size /} ${fs_bar /}
Highest CPU $alignr CPU% MEM%${color FFAA00}
${top name 1}$alignr${top cpu 1}${top mem 1}
${top name 2}$alignr${top cpu 2}${top mem 2}
${top name 3}$alignr${top cpu 3}${top mem 3}
${top name 4}$alignr${top cpu 4}${top mem 4}
${top name 5}$alignr${top cpu 5}${top mem 5}
${color}
Highest MEM $alignr CPU% MEM%${color B5FF00}
${top_mem name 1}$alignr${top_mem cpu 1}${top_mem mem 1}
${top_mem name 2}$alignr${top_mem cpu 2}${top_mem mem 2}
${top_mem name 3}$alignr${top_mem cpu 3}${top_mem mem 3}
${top_mem name 4}$alignr${top_mem cpu 4}${top_mem mem 4}
${top_mem name 5}$alignr${top_mem cpu 5}${top_mem mem 5}
${color}
$stippled_hr
NETWORK $alignr IP: ${color FFFFFF}${addr eth0}${color}
Down ${color FFFFFF}${downspeed eth0} k/s${color} $alignr Up ${color FFFFFF}${upspeed eth0} k/s${color}
${color FF8177}${downspeedgraph eth0 25,110}${color} $alignr ${color FFFFFF}${upspeedgraph eth0 25,110}${color}
Total ${color FFFFFF}${totaldown eth0}${color} $alignr Total ${color FFFFFF}${totalup eth0}

这是我从conky官网上下的一个例子修改的,要注意的是
CPU ${color FFFFFF}${alignc} ${freq dyn}MHz / ${platform f71805f.656 temp 2}°C ${alignc} MB: ${color white}${platform f71805f.656 temp 1}°C
这一行,其中的”f71805f.656“要换成你自己的实际目录中,这个目录是在/sys/devices/platform下面,名字要根据刚加载的模块生成的

最后的效果如图

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: