LINUX 桌面显示系统信息conky

来源:互联网 发布:网络分流器原理 编辑:程序博客网 时间:2024/05/18 19:47

http://jingyan.baidu.com/article/925f8cb81cb050c0dde05680.html

如何在ubuntu下详细的显示系统动态信息?如何在桌面中添加天气信息?小编今天教您使用conky给您的ubuntu桌面增添色彩!

工具/原料

  • ubuntu系统

方法/步骤

  1. 打开终端,安装包conky-all,具体代码如图

    ubuntu桌面显示系统信息conky
  2. 通常这样就可以在命令行下使用了,打开终端,输入conky,效果图如下,原装的效果很不好看

    ubuntu桌面显示系统信息conky
  3. 但是,这个软件提供了非常好的定制功能,我们可以自己编写脚本定制它,如图是小编的桌面设置,小编喜欢简洁大方,所以没有过多的修饰

    ubuntu桌面显示系统信息conky
  4. 那么倒地如何怎么办呢?请在/home/你的文件夹/创建一个文件.conkyrc,用你最喜欢的编辑器打开它,输入一下内容

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

     background yes

    cpu_avg_samples 2

    net_avg_samples 2

    out_to_console no

     # X font when Xft is disabled, you can pick one with program xfontsel

    #font 7x12

    #font 6x10

    #font 7x13

    #font 8x13

    #font 7x12

    #font *mintsmild.se*

    #font -*-*-*-*-*-*-34-*-*-*-*-*-*-*

    #font -artwiz-snap-normal-r-normal-*-*-100-*-*-p-*-iso8859-1

    # Use Xft?

     use_xft yes

     # Xft font when Xft is enabled

     xftfont Sans:size=12

    own_window_argb_visual yes

    #own_window_colour hotpink

    # Text alpha when using Xft

    xftalpha 0.8

    # on_bottom yes

    # mail spool

    mail_spool $MAIL

    # Update interval in seconds

    update_interval 1

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

    own_window yes

    own_window_transparent yes

    own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager

    #own_window_type override

    own_window_type normal

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

    double_buffer yes

    # Minimum size of text area

    minimum_size 260 5

    maximum_width 400

    # Draw shades?

    draw_shades no

    # Draw outlines?

    draw_outline no

    # Draw borders around text

    draw_borders no

    # Stippled borders?

    stippled_borders no

    # border margins

    border_margin 4

    # border width

    border_width 1

    # Default colors and also border colors

    default_color white

    default_shade_color white

    default_outline_color white

    # Text alignment, other possible values are commented

    #alignment top_left

    #minimum_size 10 10

    gap_x 40

    gap_y 100

    alignment top_right

    #alignment bottom_left

    #alignment bottom_right

    # Gap between borders of screen and text

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

    use_spacer none

    # Subtract file system buffers from used memory?

    no_buffers yes

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

    uppercase no

    # none, xmms, bmp, audacious, infopipe (default is none)

    # xmms_player bmp

    TEXT

    ${color white}SYSTEM ${hr 1}${color}

    Hostname: $alignr$nodename

    Kernel: $alignr$kernel

    Uptime: $alignr$uptime

    Temp: ${alignr}${acpitemp}掳C

    CPU: ${alignr}${freq dyn} MHz

    Processes: ${alignr}$processes ($running_processes running)

    Load: ${alignr}$loadavg

    CPU1 ${alignr}${cpu cpu1}%

    ${cpubar 4 cpu1}

    CPU2 ${alignr}${cpu cpu2}%

    ${cpubar 4 cpu2}

    Ram ${alignr}$mem / $memmax ($memperc%)

    ${membar 4}

    swap ${alignr}$swap / $swapmax ($swapperc%)

    ${swapbar 4}

    Highest CPU $alignr CPU%  MEM%

    ${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}

    Highest MEM $alignr CPU%  MEM%

    ${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}

    ${color white}FILE SYSTEM ${hr 1}${color}

    Root: ${alignr}${fs_free /} / ${fs_size /}

    ${fs_bar 4 /}

    Home: ${alignr}${fs_free /home} / ${fs_size /home}

    ${fs_bar 4 /home}

    ${color white}NETWORK ${hr 1}${color}

    Down ${downspeed wlan0} k/s ${alignr}Up ${upspeed wlan0} k/s

    ${downspeedgraph wlan0 25,107} ${alignr}${upspeedgraph wlan0 25,107}

    Total ${totaldown wlan0} ${alignr}Total ${totalup wlan0}

    #${color white}WEATHER ${hr 1}${color}

    #${execi 3600 python ~/.conkydir/conkyForecast.py --location=CHXX0101 --datatype=CN}

    #${font Weather:size=44}${color gold}${execi 3600 python ~/.conkydir/conkyForecast.py --location=CHXX0101 --datatype=WF}${font}${color}${voffset -20}${offset 18}${execi 3600 python #~/.conkydir/conkyForecast.py --location=CHXX0101 --datatype=CC}${offset 10}${execi 3600 python ~/.conkydir/conkyForecast.py --location=CHXX0101 --datatype=HT}${offset 10}${execi 3600 #python ~/.conkydir/conkyForecast.py --location=CHXX0101 --datatype=WS} ${font Arrows:size=10}${execi 3600 python ~/.conkydir/conkyForecast.py --location=CHXX0101 --datatype=BF}$font

    #${offset 60}Sol: ${color}${execi 3600 python ~/.conkydir/conkyForecast.py --location=CHXX0101 --datatype=SR}-${execi 3600 python ~/.conkydir/conkyForecast.py --location=CHXX0101 --#datatype=SS}

    #${font Weather:size=26}${execi 3600 python ~/.conkydir/conkyForecast.py --location=CHXX0101 --datatype=WF --startday=1 --endday=4 --spaces=1}${font}

    #${execi 3600 python ~/.conkydir/conkyForecast.py --location=CHXX0101 --datatype=HT --startday=1 --endday=4 --spaces=11}

    保存,这就有了和小编一样的简单显示

  5. 但它的性能远远超过小编的设置。各位可以百度 conky 配置,找到自己喜欢的conky配置文件,按照以上步骤执行即可,如果还想高度定制,请仔细了解lisp语言,并详细理解conky api,相信你一定会做出自己喜欢的系统信息显示

  6. 当然,这还没有结束,我们需要开机自启它,在dash里找startup。。。如图

    ubuntu桌面显示系统信息conky
  7. 7

    在之后出来的对话框中点击Add,然后按照如图设置即可~~完成自启

    ubuntu桌面显示系统信息conky


0 0
原创粉丝点击