LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 4133|回复: 12

我的 conky 配置

[复制链接]
发表于 2008-2-24 19:22:14 | 显示全部楼层 |阅读模式
很好,很强大






据说把aud播放器状态嵌入conkey需要单独下载conky原包才行~

因为有朋友需要,所以就单独贴配置出来共享

简单安装步骤

1,安装conky

  1. # pacman -S conky
复制代码


2,设定开机自动启动conky

  1. $ ln -s /usr/bin/conky ~/.kde/Autostart/conkylink
复制代码


3,安装 feh 包

  1. # pacman -S feh
复制代码


4,创建conky背景透明脚本

  1. $ nano -w ~/.kde/Autostart/fehconky
复制代码


5,复制以下内容到该脚本

  1. #!/bin/bash
  2. feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`

  3. use --bg-center if you use a centered wallpaper
复制代码


6,设定该脚本为可执行

  1. $ chmod +x ~/.kde/Autostart/fehconky
复制代码


7,创建 ~/.conkyrc 配置文件

  1. $ nano -w ~/.conkyrc
复制代码


8,复制以下内容到该配置文件

  1. # Conky sample configuration
  2. #
  3. # the list of variables has been removed from this file in favour
  4. # of keeping the documentation more maintainable.
  5. # Check http://conky.sf.net for an up-to-date-list.

  6. # set to yes if you want Conky to be forked in the background
  7. background no

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


  16. # Use Xft?
  17. use_xft yes

  18. # Xft font when Xft is enabled
  19. #xftfont Bitstream Vera Sans:size=11
  20. xftfont LiHei Pro:size=11

  21. # Text alpha when using Xft
  22. xftalpha 0.8

  23. # Print everything to stdout?
  24. # out_to_console no

  25. # MPD host/port
  26. # mpd_host localhost
  27. # mpd_port 6600
  28. # mpd_password tinker_bell

  29. # Print everything to console?
  30. # out_to_console no

  31. # mail spool
  32. #mail_spool $MAIL

  33. # Update interval in seconds
  34. update_interval 2.0

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

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

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

  42. # Use pseudo transparency with own_window?
  43. own_window_transparent yes

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

  46. # If own_window is yes, these window manager hints may be used
  47. #own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
  48. own_window_hints undecorated,below,sticky,skip_taskbar,skip_page

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

  51. # Minimum size of text area
  52. #minimum_size 280 5
  53. maximum_width 308

  54. # Draw shades?
  55. draw_shades yes

  56. # Draw outlines?
  57. draw_outline no

  58. # Draw borders around text
  59. draw_borders no

  60. # Draw borders around graphs
  61. draw_graph_borders yes

  62. # Stippled borders?
  63. stippled_borders 2

  64. # border margins
  65. border_margin 2

  66. # border width
  67. border_width 1

  68. # Default colors and also border colors
  69. default_color white
  70. default_shade_color black
  71. default_outline_color black

  72. # Text alignment, other possible values are commented
  73. alignment top_left
  74. #alignment top_right
  75. #alignment bottom_left
  76. #alignment bottom_right
  77. #alignment none

  78. # Gap between borders of screen and text
  79. # same thing as passing -x at command line
  80. gap_x 1350
  81. gap_y 30

  82. # Subtract file system buffers from used memory?
  83. no_buffers yes

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

  86. # number of cpu samples to average
  87. # set to 1 to disable averaging
  88. cpu_avg_samples 2

  89. # number of net samples to average
  90. # set to 1 to disable averaging
  91. net_avg_samples 2

  92. # Force UTF8? note that UTF8 support required XFT
  93. override_utf8_locale yes


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

  96. #   mldonkey_hostname     Hostname for mldonkey stuff, defaults to localhost
  97. #   mldonkey_port         Mldonkey port, 4001 default
  98. #   mldonkey_login        Mldonkey login, default none
  99. #   mldonkey_password     Mldonkey password, default none

  100. # boinc (seti) dir
  101. # seti_dir /opt/seti

  102. # Allow for the creation of at least this number of port monitors (if 0 or not set, default is 16)
  103. #min_port_monitors 16

  104. # Allow each port monitor to track at least this many connections (if 0 or not set, default is 256)
  105. # min_port_monitor_connections 256

  106. # none, xmms, bmp, audacious, infopipe (default is none)
  107. # xmms_player bmp

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

  111. # stuff after 'TEXT' will be formatted on screen

  112. #${color red}${cpugraph 0000ff 00ff00}
  113. #${color #88aadd}MPD: ${alignc}$mpd_artist - $mpd_title
  114. #${color #88aadd}$mpd_bar
  115. #${color #88aadd}${alignc}$mpd_status
  116. #${tail /var/log/Xorg.0.log 3 30}
  117. ${exec feh --bg-scale `dcop kdesktop KBackgroundIface currentWallpaper 1`}
  118. TEXT
  119. ${color yellow}${font eexp:size=20}*${font} ${color lightgrey} ${alignr} $kernel on Core Duo 2 E4500
  120. $stippled_hr
  121. ${color green}${font eexp:size=12}2${font}$color电源: $color ${alignr} $uptime ${color lightgrey}
  122. ${color lightgrey} CPU1: ${cpu cpu1 }% ${color #cc2222}${cpubar cpu1 8,70} ${color lightgrey}${alignr}CPU2: ${cpu cpu2}% ${alignr}${color #cc2222}${cpubar cpu2 8,70}
  123. ${color lightgrey} MEM:$color${alignr 80} $mem/$memmax - $memperc% ${membar}
  124. ${color lightgrey} SWAP:$color${alignr 80} $swap/$swapmax - $swapperc% ${swapbar}
  125. $color$stippled_hr
  126. ${color green}${font eexp:size=12}C${font}$color进程: $color $processes ${alignr} ${color green}${font eexp:size=12}W${font}$color运行: $color $running_processes
  127. ${color} CPU占用 ${alignr}PID       U%      M%
  128. ${color #ddaa00} ${top name 1} ${alignr}${top pid 1}   ${top cpu 1}   ${top mem 1}
  129. ${color lightgrey} ${top name 2} ${alignr}${top pid 2}   ${top cpu 2}   ${top mem 2}
  130. ${color lightgrey} ${top name 3} ${alignr}${top pid 3}   ${top cpu 3}   ${top mem 3}
  131. ${color lightgrey} ${top name 4} ${alignr}${top pid 4}   ${top cpu 4}   ${top mem 4}
  132. ${color lightgrey} ${top name 5} ${alignr}${top pid 5}   ${top cpu 5}   ${top mem 5}
  133. ${color}内存占用
  134. ${color #ddaa00} ${top_mem name 1} ${alignr}${top_mem pid 1}   ${top_mem cpu 1}   ${top_mem mem 1}
  135. ${color lightgrey} ${top_mem name 2} ${alignr}${top_mem pid 2}   ${top_mem cpu 2}   ${top_mem mem 2}
  136. ${color lightgrey} ${top_mem name 3} ${alignr}${top_mem pid 3}   ${top_mem cpu 3}   ${top_mem mem 3}
  137. ${color lightgrey} ${top_mem name 4} ${alignr}${top_mem pid 4}   ${top_mem cpu 4}   ${top_mem mem 4}
  138. ${color lightgrey} ${top_mem name 5} ${alignr}${top_mem pid 5}   ${top_mem cpu 5}   ${top_mem mem 5}
  139. $color$stippled_hr
  140. ${color green}${font eexp:size=12}^${font}$color网络:
  141. $color${font eexp:size=12}U${font} ${color #8844ee} ${downspeed eth0} k/s$color ${offset 80}${font eexp:size=12}O${font} ${color #22ccff} ${upspeed eth0} k/s
  142. ${color #0000ff}${downspeedgraph eth0 22,150 ff0000 0000ff} ${color #22ccff}${upspeedgraph eth0 22,150 0000ff ff0000}
  143. $color ${font eexp:size=12}0${font}内网: ${tcp_portmon 1 32767 count} ${alignc -15} ${font eexp:size=12}1${font}外网: ${tcp_portmon 32768 61000 count}${alignr}总共: ${tcp_portmon 1 65535 count}
  144. ${color #ddaa00}本地链接 ${alignr} 本地服务/端口$color
  145. ${tcp_portmon 1 32767 rhost 0} ${alignr} ${tcp_portmon 1 32767 lservice 0}
  146. ${tcp_portmon 1 32767 rhost 1} ${alignr} ${tcp_portmon 1 32767 lservice 1}
  147. ${tcp_portmon 1 32767 rhost 2} ${alignr} ${tcp_portmon 1 32767 lservice 2}
  148. ${color #ddaa00}外部链接 ${alignr} 远程服务/端口$color
  149. ${tcp_portmon 32768 61000 rhost 0} ${alignr} ${tcp_portmon 32768 61000 rservice 0}
  150. ${tcp_portmon 32768 61000 rhost 1} ${alignr} ${tcp_portmon 32768 61000 rservice 1}
  151. ${tcp_portmon 32768 61000 rhost 2} ${alignr} ${tcp_portmon 32768 61000 rservice 2}
  152. ${tcp_portmon 32768 61000 rhost 3} ${alignr} ${tcp_portmon 32768 61000 rservice 3}
  153. ${tcp_portmon 32768 61000 rhost 4} ${alignr} ${tcp_portmon 32768 61000 rservice 4}
  154. ${tcp_portmon 32768 61000 rhost 5} ${alignr} ${tcp_portmon 32768 61000 rservice 5}
  155. $stippled_hr
  156. ${color green}${font eexp:size=14}&${font}$color磁盘
  157. $color / ${alignr 100}${fs_used /}/${fs_size /}  ${fs_bar /}
  158. $color /tmp ${alignr 100}${fs_used /tmp}/${fs_size /tmp}  ${fs_bar /tmp}
  159. $color /boot ${alignr 100}${fs_used /boot}/${fs_size /boot}  ${fs_bar /boot}
  160. $color /home ${alignr 100}${fs_used /home}/${fs_size /home}  ${fs_bar /home}
  161. $color 应用软件 ${alignr 100}${fs_used /mnt/sda7}/${fs_size /mnt/sda7}  ${fs_bar /mnt/sda7}
  162. $color 文档资料 ${alignr 100}${fs_used /mnt/sda8}/${fs_size /mnt/sda8}  ${fs_bar /mnt/sda8}
  163. $color 系统备份 ${alignr 100}${fs_used /mnt/sda9}/${fs_size /mnt/sda9}  ${fs_bar /mnt/sda9}
复制代码


[color="Red"]注意:
1,我的屏幕是22寸宽的分辨率,如果看不到conky请修改
gap_x 1350
gap_y 30
2,磁盘的监视设置请自行按自己需求修改~
3,附件提供的字体必须安装,否则图标失效!
4,显卡3D加速必须开启,否则可能出现屏幕闪的问题~(本人是ati卡用的是fglrx驱动此配置无问题)

如有conky设置比较好的建议和发现,希望大家都共享出来~

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2008-2-24 21:55:43 | 显示全部楼层
谢谢,效果真不错,要是显示天气就完美啦
回复 支持 反对

使用道具 举报

发表于 2008-2-24 22:12:06 | 显示全部楼层
# Text alignment, other possible values are commented
[color="Red"]#alignment top_left
[color="#ff0000"]alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none

[color="#ff0000"]#gap_x 1350
gap_y 30

这样就没有说不是宽屏不能用的问题 ^ ^而且认为这样效率比较好
回复 支持 反对

使用道具 举报

发表于 2008-2-24 22:43:57 | 显示全部楼层
还行。。。。
回复 支持 反对

使用道具 举报

发表于 2008-2-25 10:00:37 | 显示全部楼层
不错,这个风格很眼熟,在conky官方有很多例子可以参考,好久没用conky了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2008-2-25 10:10:03 | 显示全部楼层
Post by jarryson;1819667
# Text alignment, other possible values are commented
[color="Red"]#alignment top_left
[color="#ff0000"]alignment top_right
#alignment bottom_left
#alignment bottom_right
#alignment none

[color="#ff0000"]#gap_x 1350
gap_y 30

这样就没有说不是宽屏不能用的问题 ^ ^而且认为这样效率比较好


有道理,没注意那个注释:Coffee:
回复 支持 反对

使用道具 举报

发表于 2008-2-26 00:52:10 | 显示全部楼层
那个星际翻王怎么安装哦?
回复 支持 反对

使用道具 举报

发表于 2008-2-26 01:39:50 | 显示全部楼层
Post by SecretZero;1820066
那个星际翻王怎么安装哦?


pacman -S stardict

another version of stardict is also available in AUR
回复 支持 反对

使用道具 举报

发表于 2008-2-26 18:44:57 | 显示全部楼层
Post by oxygen427;1819656
谢谢,效果真不错,要是显示天气就完美啦


官方论坛有Conky显示天气的脚本, 用AccuWeather网站的预报
回复 支持 反对

使用道具 举报

发表于 2008-4-18 22:06:18 | 显示全部楼层
如何解决如cpu显示数字9 变成14的时候 改数字后面的东东左右移动的问题亚
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表