LinuxSir.cn,穿越时空的Linuxsir!

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

conky相关问题,刚升级后

[复制链接]
发表于 2010-4-3 16:09:30 | 显示全部楼层 |阅读模式
  1. background no
  2. override_utf8_locale yes
  3. font DejaVu Sans:size=8
  4. xftfont DejaVu Sans:size=8
  5. #font DejaVu Sans:size=8
  6. #xftfont DejaVu Sans:size=8
  7. use_xft yes
  8. xftalpha 0.6

  9. update_interval 1.0
  10. total_run_times 0
  11. own_window yes
  12. #own_window_type desktop
  13. own_window_type normal
  14. own_window_transparent yes
  15. own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
  16. double_buffer yes
  17. draw_shades no
  18. draw_outline no
  19. draw_borders no
  20. draw_graph_borders no
  21. #minimum_size 180 5
  22. maximum_width 180

  23. #alignment top_left
  24. #alignment top_right
  25. #alignment bottom_left
  26. alignment bottom_right
  27. #alignment none
  28. gap_x 5
  29. gap_y 25
  30. no_buffers yes
  31. cpu_avg_samples 2
  32. override_utf8_locale yes
  33. uppercase no # set to yes if you want all text to be in uppercase
  34. use_spacer none
  35. out_to_console no


  36. default_color lightgrey
  37. #default_color moccasin
  38. default_shade_color black
  39. default_outline_color grey70



  40. TEXT
  41. ${color gold}${font OpenLogos:size=48}A
  42. ${voffset -70}${offset 60}${color moccasin}${font DejaVu Sans:size=22}${time %H:%M:%S}
  43. ${voffset -15}${color}${font}${alignr}${time %A/%m.%d.%G}
  44. ${color slate grey}$hr
  45. ${color slate grey}${font}Time:${color}${alignr}$uptime
  46. ${color slate grey}Kern:${color}${alignr}linux-$kernel-$machine
  47. ${color slate grey}CPU:${color}${alignr}${cpu cpu1}% ${cpu cpu2}%  ${freq_g cpu}GHz ${acpitemp}℃
  48. ${if_existing /proc/acpi/battery/BAT0/state yes}
  49. ${color slate grey}${font}Battery:${color}${alignr}${battery_percent}%${endif}
  50. ${color slate grey}Processes:${color}${alignr}$processes($running_processes running)
  51. ${color slate grey}$stippled_hr
  52. ${color slate grey}Highest CPU:$alignr -PID-  CPU%
  53. ${color}${top name 1}$alignr${top pid 1}${top cpu 1}
  54. ${color}${top name 2}$alignr${top pid 2}${top cpu 2}
  55. ${color}${top name 3}$alignr${top pid 3}${top cpu 3}
  56. ${color slate grey}$stippled_hr
  57. ${color slate grey}Highest MEM:$alignr -PID-  MEM%
  58. ${color}${top_mem name 1}$alignr${top_mem pid 1}${top_mem mem 1}
  59. ${color}${top_mem name 2}$alignr${top_mem pid 2}${top_mem mem 2}
  60. ${color}${top_mem name 3}$alignr${top_mem pid 3}${top_mem mem 3}
  61. ${color slate grey}$hr
  62. ${color slate grey}${font}MEM:$memperc%${color}$alignr$mem/$memmax
  63. ${color}${membar 3,180}
  64. ${color slate grey}SWAP:$swapperc%${color}$alignr$swap/$swapmax
  65. ${color}${swapbar 3,180}
  66. ${color slate grey}BOOT:${fs_used_perc /boot}%${color}$alignr${fs_used /boot}/${fs_size /boot}
  67. ${color}${fs_bar 3,180 /boot}
  68. ${color slate grey}ROOT:${fs_used_perc /}%${color}$alignr${fs_used /}/${fs_size /}
  69. ${color}${fs_bar 3,180 /}
  70. ${color slate grey}HOME:${fs_used_perc /home}%${color}$alignr${fs_used /home}/${fs_size /home}
  71. ${color}${fs_bar 3,180 /home}
  72. ${color slate grey}Disk Read:${color}${alignr}$diskio_read
  73. ${color}${diskiograph_read /dev/sda 10,180}
  74. ${color slate grey}Disk Write:${color}${alignr}$diskio_write
  75. ${color}${diskiograph_write /dev/sda 10,180}${if_match "$mpd_status"!="Stopped"}
  76. ${color slate grey}$hr
  77. ${color slate grey}Music:${color}${alignr}Now ${mpd_status}
  78. ${color slate grey}Title:${color lightgrey}${alignr}${mpd_title}
  79. ${color slate grey}Artist:${color lightgrey}${alignr}${mpd_artist}
  80. ${color slate grey}Time:${color}${alignr}${mpd_elapsed}/${mpd_length}
  81. ${color slate grey}Volume:${color}${mpd_vol}%${color slate grey}${alignr}Bitrate:${color}${mpd_bitrate} kbps${endif}${if_existing /proc/net/route wlan0}
  82. ${color slate grey}$hr
  83. ${color slate grey}${font}Wireless:${color}${alignr}${addr wlan0}
  84. ${color slate grey}Tot.up.${color}${alignr}${totalup wlan0}
  85. ${color slate grey}Up:${color}${alignr}${upspeed wlan0}k/s
  86. ${color}${upspeedgraph wlan0 10,180}
  87. ${color slate grey}Tot.dow.${color}${alignr}${totaldown wlan0}
  88. ${color slate grey}Down:${color}${alignr}${downspeed wlan0}k/s
  89. ${color}${downspeedgraph wlan0 10,180}${else}${if_existing /proc/net/route ppp0}
  90. ${color slate grey}$hr
  91. ${color slate grey}${font}PPP0:${color}${alignr}${addr ppp0}
  92. ${color slate grey}Tot.up.${color}${alignr}${totalup ppp0}
  93. ${color slate grey}Up:${color}${alignr}${upspeed ppp0}k/s
  94. ${color}${upspeedgraph ppp0 10,180}
  95. ${color slate grey}Tot.dow.${color}${alignr}${totaldown ppp0}
  96. ${color slate grey}Down:${color}${alignr}${downspeed ppp0}k/s
  97. ${color}${downspeedgraph ppp0 10,180}${else}${if_existing /proc/net/route eth0}
  98. ${color slate grey}$hr
  99. ${color slate grey}${font}eth0:${color}${alignr}${addr eth0}
  100. ${color slate grey}Tot.up.${color}${alignr}${totalup eth0}
  101. ${color slate grey}Up:${color}${alignr}${upspeed eth0}k/s
  102. ${color}${upspeedgraph eth0 10,180}
  103. ${color slate grey}Tot.dow.${color}${alignr}${totaldown eth0}
  104. ${color slate grey}Down:${color}${alignr}${downspeed eth0}k/s
  105. ${color}${downspeedgraph eth0 10,180}${endif}${endif}${endif}
  106. ${color slate grey}$hr
  107. ${color slate grey}${font}Mail:${alignr}${color}You have ${color moccasin}${texeci 1800 perl ~/Sh/.check_gmail.sh} ${color}new mail(s)
  108. ${voffset -55}
复制代码

其中的网络部分
不知为何,一直显示的是wlan0,而实际上我只使用了ppp0拨号
更新之前是没有问题的
 楼主| 发表于 2010-4-3 16:17:02 | 显示全部楼层
电池显示也不正常了
相关部分改成这样了
  1. ${if_match ${battery_percent BAT0} > 0}
  2. ${color slate grey}${font}Battery:${color}${alignr}${battery_percent}%${endif}
复制代码
嗯,插入电池后则显示电量
回复 支持 反对

使用道具 举报

发表于 2010-4-3 16:25:18 | 显示全部楼层
把文件里的wlan0字段全替换成ppp0
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-4-3 16:27:09 | 显示全部楼层
Post by kamui0523;2080312
把文件里的wlan0字段全替换成ppp0

呃,那当仅有无线网络时候呢?
再改回来?
我的意思是先检测有无无线,如没有则再检测有无ppp拨号,如没有则显示eth0
实际上由于我的网络环境变更比较多,所以我一般也要检测有无eth0,因为rc.conf中本人并没设置eth0的IP或dhcp
回复 支持 反对

使用道具 举报

发表于 2010-4-3 16:29:33 | 显示全部楼层
我这都是eth0+wlan0这样显示的...
回复 支持 反对

使用道具 举报

发表于 2010-4-4 00:44:56 | 显示全部楼层
不透明了是咋回事呢
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-4-6 21:08:12 | 显示全部楼层
shit ,没人玩 conky?
现在的网络显示也通过${if_match "${addr ppp0}"!="No Address"}来匹配显示了
回复 支持 反对

使用道具 举报

 楼主| 发表于 2010-4-6 22:28:55 | 显示全部楼层
晕,有个更简单的参数
if_up           (interface)         if INTERFACE exists and is up, display everything between $if_up and the matching $endif
if_mpd_playing                    if mpd is playing or paused, display everything between $if_mpd_playing and the matching $endif
回复 支持 反对

使用道具 举报

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

本版积分规则

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