Chinaunix首页 | 论坛 | 博客
  • 博客访问: 170330
  • 博文数量: 55
  • 博客积分: 1410
  • 博客等级: 上尉
  • 技术积分: 620
  • 用 户 组: 普通用户
  • 注册时间: 2008-03-04 14:13
文章分类
文章存档

2009年(1)

2008年(54)

我的朋友

分类:

2008-05-15 01:03:38

不仅十分小巧,它不会消耗多少系统资源空间;而且可以很漂亮,本身支持伪透明特性,能够嵌入到桌面中。用于实时监视系统,了解系统运行之状况,实在是不二之选。
         安装是非常简单的,一句 sudo apt-get install conky 就可搞定。

         Conky 默认并不会创建配置文件,需要使用下列命令手动生成:

zcat /usr/share/doc/conky/examples/conky.conf.gz > ~/.conkyrc

         配置,主要注意下面几点:
  1. 定义字体:使用 xftfont Luxi Sans:size=8 这行可以定义 Conky 的全局字体,其格式为字体名称:大小,也可使用字体样式,如粗体可用 style=Bold 来表示。
  2. 显示位置:假如我要让 Conky 在右上角显示,就去掉 alignment top_right 这行的注释符,相应的注释其余的行,如下所示。

    #alignment top_left
    alignment top_right
    #alignment bottom_left
    #alignment bottom_right
    #alignment none
  3. 大小及边框:分别由 minimum_sizeborder_width 来确定,前者的设置格式为宽x高,不要边框的话,可将后者设置为 0。
  4. 显示信息:在 Conky 配置文件的最后部分可以定义具体显示什么内容。这里主要是了解一些变量的使用,比如,显示系统从开机到现在所运行的总共时间,可以使用 uptime 变量,变量前面要用 $ 表示。更多变量的含义可以查看 Conky 主页的 。
         我的.conkyrc配置,和字体附件,效果图

文件:conkyfonts.tar.gz
大小:196KB
下载:下载



 
override_utf8_locale yes
font iYaHei:size=9
xftfont iYaHei:size=9

# Conky sample configuration
#
# the list of variables has been removed from this file in favour
# of keeping the documentation more maintainable.
# Check for an up-to-date-list.

# set to yes if you want Conky to be forked in the background
background yes

# X font when Xft is disabled, you can pick one with program xfontsel
#font 5x7
#font 6x10
#font 7x13
#font 8x13
#font 9x15
#font *mintsmild.se*
#font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

# Use Xft?
use_xft yes



# Text alpha when using Xft
xftalpha 1.0

# Print everything to stdout?
# out_to_console no

# MPD host/port
# mpd_host localhost
# mpd_port 6600
# mpd_password tinker_bell

# Print everything to console?
# out_to_console no

# mail spool
#mail_spool $MAIL

# Update interval in seconds
update_interval 2.0

# This is the number of times Conky will update before quitting.
# Set to zero to run forever.
total_run_times 0

# Create own window instead of using desktop (required in nautilus)
own_window yes

# If own_window is yes, you may use type normal, desktop or override
own_window_type override

# Use pseudo transparency with own_window?
own_window_transparent yes

# If own_window_transparent is set to no, you can set the background colour here
# own_window_colour hotpink

# If own_window is yes, these window manager hints may be used
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

# Use double buffering (reduces flicker, may not work for everyone)
double_buffer yes

# Minimum size of text area
minimum_size 400 5

# Draw shades?
draw_shades no

# Draw outlines?
draw_outline no

# Draw borders around text
draw_borders no

# Draw borders around graphs
draw_graph_borders yes

# Stippled borders?
stippled_borders 8

# border margins
border_margin 4

# border width
border_width 1

# Default colors and also border colors
default_color white
default_shade_color black
default_outline_color black

# Text alignment, other possible values are commented
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none

# Gap between borders of screen and text
# same thing as passing -x at command line
gap_x 8
gap_y 30

# Subtract file system buffers from used memory?
no_buffers yes

# set to yes if you want all text to be in uppercase
uppercase no

# number of cpu samples to average
# set to 1 to disable averaging
cpu_avg_samples 2

# number of net samples to average
# set to 1 to disable averaging
net_avg_samples 2

# Force UTF8? note that UTF8 support required XFT
override_utf8_locale yes

# Add spaces to keep things from moving about?  This only affects certain objects.
use_spacer no

# Allow each port monitor to track at most this many connections (if 0 or not set, default is 256)
#max_port_monitor_connections 256

# Maximum number of special things, e.g. fonts, offsets, aligns, etc.
#max_specials 512

# Maximum size of buffer for user text, i.e. below TEXT line.
#max_user_text 16384

# Timing interval for music player thread, e.g. mpd, audacious
#music_player_interval (update_interval is default)

# variable is given either in format $variable or in ${variable}. Latter
# allows characters right after the variable and must be used in network
# stuff because of an argument

# stuff after 'TEXT' will be formatted on screen

#${color #88aadd}MPD: ${alignc}$mpd_artist - $mpd_title
#${color #88aadd}$mpd_bar
#${color #88aadd}${alignc}$mpd_status
#${color red}${cpugraph 0000ff 00ff00}
#${color #0000ff}${downspeedgraph eth1 32,150 ff0000 0000ff} ${color #22ccff}${upspeedgraph eth1 32,150 0000ff ff0000}

TEXT
${color}${font StyleBats:size=13}Q ${font} ${alignc}$nodename - $sysname $kernel on $machine
${color}${font PizzaDude Bullets:size=10}.${font} ${color  #dcff82}系统信息:   ${color}${font iYaHei:pixelsize=15}${time %H:%M}  ${font iYaHei:size=9}${time %Y/%m/%d}${font OpenLogos:size=15}
${voffset -20}${color}${font StyleBats:size=11}O ${font}${color lightgrey}开机时长:$color $uptime ${color lightgrey} on $color${exec whoami}
${color}${font StyleBats:size=12}A ${font}${color lightgrey}CPU 使用: $color${freq cpu0}MHz(Freq) $acpitemp°C(T) ${color #dcff82}${cpu cpu} ${cpubar}
 ${color lightgrey}硬盘状态: $color $diskio(IO) ${hddtemp /dev/sda}(Temperature)
 ${color lightgrey}内存使用:$color $mem/$memmax - $memperc% ${color  #dcff82}${membar}
 ${color lightgrey}交换空间:$color $swap/$swapmax - $swapperc% ${color  #dcff82}${swapbar}
 ${color lightgrey}总进程:$color $processes  ${color lightgrey}当前运行:$color $running_processes
${color  #dcff82}文件系统:
 ${color}/ $color${fs_used /}/${fs_size /} ${color  #dcff82}${fs_bar /}
 ${color}/home $color${fs_used /home}/${fs_size /home} ${color  #dcff82}${fs_bar /home}
 ${color}/media/disk $color${fs_used /media/disk}/${fs_size /media/disk} ${color  #dcff82}${fs_bar /media/disk}
$color$stippled_hr
${color}${font Webdings:size=12}i ${font}${color  #dcff82}cpu使用排行榜:
${color lightgrey} 名称                   PID        CPU%      内存%
${color}  ${top name 1}    ${top pid 1}    ${top cpu 1}    ${top mem 1}
${color}  ${top name 2}    ${top pid 2}    ${top cpu 2}    ${top mem 2}
${color}  ${top name 3}    ${top pid 3}    ${top cpu 3}    ${top mem 3}
${color}${font Webdings:size=12}i ${font}${color  #dcff82}内存使用排行榜
${color lightgrey} 名称                   PID        CPU%      内存%
${color}  ${top_mem name 1}    ${top_mem pid 1}    ${top_mem cpu 1}    ${top_mem mem 1}
${color}  ${top_mem name 2}    ${top_mem pid 2}    ${top_mem cpu 2}    ${top_mem mem 2}
${color}  ${top_mem name 3}    ${top_mem pid 3}    ${top_mem cpu 3}    ${top_mem mem 3}
$stippled_hr
${color  #dcff82}网络服务:
 ${voffset 1}${color}${font PizzaDude Bullets:size=10}r${font}${color}ppp0(下行):${color #325a96} ${downspeed ppp0} k/s ${alignr}${voffset 6}${color}${font PizzaDude Bullets:size=10}S${font}${font}${color}全部接收:${totaldown ppp0}
${totalup ppp0}
${color  #dcff82}${upspeedgraph ppp0 8,300}
 ${voffset 1}${color}${font PizzaDude Bullets:size=10}v${font}${color}ppp0(上行):${color #325a96} ${upspeed ppp0} k/s ${alignr}${color}${font PizzaDude Bullets:size=10}M${font}${color}全部发送: ${totalup ppp0}
${totalup ppp0}
${color  #dcff82}${upspeedgraph ppp0 8,300}
$color 进入: ${tcp_portmon 1 32767 count}  出去: ${tcp_portmon 32768 61000 count}${alignr}总共: ${tcp_portmon 1 65535 count}
${color  #dcff82}发送 ${alignr} 外地服务/端口$color
 ${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
 ${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
 ${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
${color  #dcff82}进入 ${alignr} 本地服务/端口$color
 ${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
                                           ${color ff0000}${font openlogos:size=27} u${font}
阅读(2716) | 评论(4) | 转发(0) |
0

上一篇:计算cpu时间

下一篇:也说Ubuntu混音

给主人留下些什么吧!~~

relaxssl2009-01-01 13:15:20

我个人感觉这个东西用途不大,了解和没有了解系统的这些信息还是一样使用,而放这个东西在桌面反而影响注意力,每次看到都要花那么一点时间去了解,遇到一些皮毛的问题又想去了解并解决,其实本身没什么问题,大不了就是重启搞掂,但人的好奇心总会驱使着去弄个明白,一天的时间就这样白白浪费了。

chinaunix网友2008-07-14 22:47:01

背景好花

chinaunix网友2008-06-05 00:21:14

这个脚本看着有点眼熟哦~~~呵呵~~~~ubuntu中文里见过

chinaunix网友2008-05-15 22:38:45

我也挑刺,呵呵~~~不过挑不出来,写得不错,学习了!