所以我最近一直在设置我最近下载的新 conky(我正在运行 Ubuntu 12.04)。我在 conky 中测量网络参数的部分遇到了问题。我查看了 .conkyrc_net 文件,发现其中多次提到 Eth1。我想知道如果我将此代码更改为 wlan0,它是否会解决我遇到的问题并开始测量我的 wifi 网络参数?
我对 Linux 还很陌生,没有编写代码的经验,但我花了两天时间研究它,并想尝试解决这个问题。
以下是 conkyrc_net 文件中的代码:
background yes
font ubuntu:size=8
xftfont ubuntu:size=8
use_xft yes
xftalpha 0.5
update_interval 1.0
total_run_times 0
own_window yes
own_window_type override
own_window_transparent no
own_window_hints undecorate,sticky,skip_taskbar,skip_pager
double_buffer yes
draw_shades no
draw_outline no
draw_borders yes
border_width 1
draw_graph_borders yes
minimum_size 180
maximum_width 220
default_color 5382BA
default_shade_color 000000
own_window_colour 191919
color3 737373 #graph border
color2 FFFFFF #title
color1 FFFFFF #text
color0 FFA500 #icon
alignment top_right
gap_x 30
gap_y 656
no_buffers yes
cpu_avg_samples 2
override_utf8_locale yes
uppercase no
use_spacer none
temperature_unit fahrenheit
TEXT
${color0}${font ConkySymbols:size=16}i${font}${color} ${color2}NETWORK»${color}
${color1}Up $alignr${upspeed eth1}k/s
${color3}${upspeedgraph eth1 20,183 474747 E9E9E9}${color}
${color1}Total Up $alignr${totalup eth1}${color}
${color1}Down $alignr${downspeed eth1}k/s
${color3}${downspeedgraph eth1 20,183 474747 E9E9E9}${color}
${color1}Total Down $alignr${totaldown eth1}${color}
${color1}Local IP $alignr${addr eth1}
External IP $alignr${execi 1 ~/.scripts/ip.sh}${color}
我假设这个文件的问题仅仅在于它的 _net 引用:)
任何帮助将非常感激 :)
答案1
改为 wlan0 可能会有效。
这是我的 conky 的“无线部分”...(仅供参考)
${if_existing /proc/net/route wlan1}${color1}${font Liberation:style=Bold:pixelsize=12}活动网络:wlan1${hr 2 } ${voffset 2}${font VariShapes Solid:pixelsize=12}q${goto 18}${voffset -3}${font}向上:${color2}${upspeed wlan1} ${alignr}${color3}${upspeedgraph wlan1 20,160}${color1} ${font}${voffset -24}${goto 18}总计:${color2}${totalup wlan1}${color1} ${voffset -3}${font VariShapes Solid:pixelsize=12}Q${goto 18}${voffset -3}${font}向下: ${color2}${downspeed wlan1} ${alignr}${color3}${downspeedgraph wlan1 20,160}${color1} ${font}${voffset -24}${goto 18}总计:${color2}${totaldown wlan1} ${color1}${font Liberation:style=Bold:pixelsize=12}无线${hr 2 } ${voffset -2}${font VariShapes Solid:pixelsize=12}-${goto 18}${voffset -0}${font Liberation:style=normal:pixelsize=12}无线接入点:${color2}${alignr}${wireless_essid wlan1} ${color1}${voffset 2}${font Stylebats:pixelsize=12}Z${goto 18}${voffset -3}${font Liberation:style=normal:pixelsize=12}连接强度:${color2}${alignr}${wireless_link_qual_perc wlan1}% ${color1}${voffset 2}${font Stylebats:pixelsize=12}C${goto 18}${voffset -3}${font Liberation:style=normal:pixelsize=12}连接最大吞吐量:${color2}${alignr}${wireless_bitrate wlan1} ${color1}${font Liberation:style=Bold:pixelsize=12}${voffset -3}${hr 2} ${voffset -1}${font Poky:pixelsize=12}w${goto 19}${voffset -1}${font Liberation:style=normal:pixelsize=12}本地 IP: ${color2}${alignr}${addr wlan1} ${color1}${voffset -1}${font Poky:pixelsize=12}w${goto 19}${voffset -1}${font Liberation:style=normal:pixelsize=12}Internet IP:${color2}${alignr}${execi 300 ~/.scripts/ip.sh}${else}${endif}
我的 conky 真的很紧凑,因为里面有“很多东西”,它使它们刚好适合。conky 配置中的额外行空间将把你的 conky 延伸到桌面下方。