分类:
2008-05-15 01:03:38
sudo apt-get install conky
就可搞定。zcat /usr/share/doc/conky/examples/conky.conf.gz > ~/.conkyrc
配置,主要注意下面几点:
xftfont Luxi Sans:size=8
这行可以定义 Conky 的全局字体,其格式为字体名称:大小,也可使用字体样式,如粗体可用 style=Bold
来表示。alignment top_right
这行的注释符,相应的注释其余的行,如下所示。
#alignment top_left
alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none
minimum_size
和 border_width
来确定,前者的设置格式为宽x高,不要边框的话,可将后者设置为 0。uptime
变量,变量前面要用 $
表示。更多变量的含义可以查看 Conky 主页的 。
|
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} |