Então eu ouvi muito sobre o conky e queria tentar. Eu adicionei TeeJee ppa , instalei e baixei o pacote oficial de temas. O problema é que o conky não consegue detectar a interface de rede. Depois de passar algum tempo no Google, percebi que tenho que substituir eth0
por enp1s0
para obter o trabalho conky com conexão de rede. Então aqui está o meu atual widget systemstat
que vem com o tema TransparentTilesV3 :
TEXT
${voffset -2}${font Open Sans Light:bold:size=9}HARD DRIVEs$font${voffset 10}
HOME ${alignr}${color5}${fs_bar 12,200 /home}
${voffset -18}${offset 5}${color}${alignr 5}$color${fs_free /home}$color$font
SYSTEM ${alignr}${color5}${fs_bar 12,200 /}
${voffset -18}${offset 5}${color}${alignr 5}$color${fs_free /} free$color$font
${voffset -8}
${font Open Sans Light:bold:size=9}NETWORK$font${voffset -14}
${if_existing /proc/net/route wlan0}
${color}Up:${color} ${color2}${upspeed wlan0}${color}${alignr}${color}Sent:${color} ${color2}${totalup wlan0}${color}
${color}Down:${color} ${color2}${downspeed wlan0}${color}${alignr}${color}Received:${color} ${color2}${totaldown wlan0}${color}
${else}${if_existing /proc/net/route wlan1}
${color}Up:${color} ${color2}${upspeed wlan1}${color}${alignr}${color}Sent:${color} ${color2}${totalup wlan1}${color}
${color}Down:${color} ${color2}${downspeed wlan1}${color}${alignr}${color}Received:${color} ${color2}${totaldown wlan1}${color}
${else}${if_existing /proc/net/route enp1s0}
${color}Up:${color} ${color2}${upspeed enp1s0}${color}${alignr}${color}Sent:${color} ${color2}${totalup enp1s0}${color}
${color}Down:${color} ${color2}${downspeed enp1s0}${color}${alignr}${color}Received:${color} ${color2}${totaldown enp1s0}${color}
${else}${if_existing /proc/net/route eth1}
${color}Up:${color} ${color2}${upspeed eth1}${color}${alignr}${color}Sent:${color} ${color2}${totalup eth1}${color}
${color}Down:${color} ${color2}${downspeed eth1}${color}${alignr}${color}Received:${color} ${color2}${totaldown eth1}${color}
${else}${if_existing /proc/net/route ppp0}
${color}Up:${color} ${color2}${upspeed ppp0}${color}${alignr}${color}Sent:${color} ${color2}${totalup ppp0}${color}
${color}Down:${color} ${color2}${downspeed ppp0}${color}${alignr}${color}Received:${color} ${color2}${totaldown ppp0}${color}
${else}${if_existing /proc/net/route ppp1}
${color}Up:${color} ${color2}${upspeed ppp1}${color}${alignr}${color}Sent:${color} ${color2}${totalup ppp1}${color}
${color}Down:${color} ${color2}${downspeed ppp1}${color}${alignr}${color}Received:${color} ${color2}${totaldown ppp1}${color}
${else}${if_existing /proc/net/route usb0}
${color}Up:${color} ${color2}${upspeed usb0}${color}${alignr}${color}Sent:${color} ${color2}${totalup usb0}${color}
${color}Down:${color} ${color2}${downspeed usb0}${color}${alignr}${color}Received:${color} ${color2}${totaldown usb0}${color}
${else}${if_existing /proc/net/route usb1}
${color}Up:${color} ${color2}${upspeed usb1}${color}${alignr}${color}Sent:${color} ${color2}${totalup usb1}${color}
${color}Down:${color} ${color2}${downspeed usb1}${color}${alignr}${color}Received:${color} ${color2}${totaldown usb1}${color}
${else}
Network disconnected
${color5}Connect to a network to see statistics${color}
${voffset 74}
${endif}${endif}${endif}${endif}${endif}${endif}${endif}${endif}${voffset -61}
Acabei de pesquisar por texto: eth0 e substituí-lo por enp1s0, mas nem todo widget vem com o texto eth0
, por exemplo, o widget de notícias:
# conky package by qaisar nawaz
# Conky settings #
background no
update_interval 900
double_buffer yes
no_buffers yes
# Window specifications #
own_window yes
own_window_type normal
own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
own_window_title
own_window_colour bebebe
own_window_argb_visual yes
own_window_argb_value 205
minimum_size 549 85
maximum_width 549
# Alignment #
alignment tr
gap_x 55
gap_y 341
border_inner_margin 10
border_outer_margin 0
# Graphics settings #
draw_shades no
draw_outline no
draw_borders no
draw_graph_borders no
# Text settings #
use_xft yes
xftalpha 0
xftfont Open Sans Light:size=10
override_utf8_locale yes
imlib_cache_size 0
# Color scheme #
default_color 333333
color1 0099CC
color2 9933CC
color3 669900
color4 FF8800
color5 CC0000
color6 AAAAAA
color7 DDDDDD
TEXT
${voffset -4}${color1}${font Open Sans Light:size=12}Top Stories - Google News$color$font
${voffset 1}${exec python ./news.py}
${voffset -28}
Eu até tentei envolver a parte TEXT dentro de um loop for assim:
TEXT
${if_existing /proc/net/route enp1s0}
${voffset -4}${color1}${font Open Sans Light:size=12}Top Stories - Google News$color$font
${voffset 1}${exec python ./news.py}
${voffset -28}
${endif}
Mas ainda sem sorte ... Como posso dizer ao conky para usar enp1s0 globalmente, em vez de eth0?