1.先安装conky
sudo dnf install conky
use_spacer right
use_xft yes
font Microsoft YaHei:size=8
xftfont Microsoft YaHei:size=8
override_utf8_locale yes
update_interval 3.0
own_window yes
own_window_type normal
own_window_transparent yes
own_window_argb_visual yes
own_window_argb_value 255
own_window_hints undecorate,sticky,skip_taskbar,skip_pager,below
#own_window_type normal
#own_window_transparent no
#own_window_hints undecorated,below,sticky,skip_taskbar,skip_pager
#own_window_argb_visual yes
#own_window_argb_value 0
double_buffer yes
minimum_size 206 5
maximum_width 400
draw_shades yes
draw_outline no
draw_borders no
draw_graph_borders no
default_color 00ff00
default_shade_color 000000
default_outline_color 000000
alignment top_right
gap_x 5
gap_y 35
cpu_avg_samples 2
uppercase no # set to yes if you want all text to be in uppercase
# Color scheme #
default_color FFFFFF
color1 FFFF00
color2 FFFF0a
color3 FFFF00
color4 FFFF00
color5 DCDCDC
color6 FFFF00
color7 FFFF00
color8 FFFF00
TEXT
# Weather
${execi 300 curl -s "http://weather.yahooapis.com/forecastrss?w=493776&u=c" -o ~/.cache/weather.xml}
\
${goto 36}${voffset 0}${font Droid Sans :size=36}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "temp=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}°${font}${color}
${goto 46}${voffset 14}${font Droid Sans :size=12}${color1}${execi 300 grep "yweather:condition" ~/.cache/weather.xml | grep -o "text=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*"}${font}${color}
\
${color3}${voffset 30}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2' | tr '[a-z]' '[A-Z]'}${color}
${color3}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "day=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3' | tr '[a-z]' '[A-Z]'}${color}
\
${color2}${voffset 40}${alignc 77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1'}°${color}
${color2}${voffset -13}${alignc}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2'}°${color}
${color2}${voffset -13}${alignc -77}${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "low=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°/${execi 300 grep "yweather:forecast" ~/.cache/weather.xml | grep -o "high=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3'}°
${font Microsoft YaHei:pixelsize=12}
${color #00ffcf}主机名:${color #00ffcf} $alignr$nodename
${color #00ffcf}内核: ${color #00ffcf}$alignr$kernel
${color #00ffcf}已运行时间: ${color #00ffcf}$alignr$uptime
${color #ffd700}${stippled_hr 1}
${font Microsoft YaHei:pixelsize=12}
${color #00ff1e}CPU 0: ${cpu cpu0}% $alignr$acpitemp°C(T)
${color #dcff82}${cpubar 8 cpu0}
${color #00ff1e}CPU 1: ${cpu cpu1}%
${color #dcff82}${cpubar 8 cpu1}
${color #00ff1e}CPU占用:$alignr CPU%
${color #ddaa00} ${top name 1}$alignr${top cpu 1}
${color lightgrey} ${top name 2}$alignr${top cpu 2}
${color lightgrey} ${top name 3}$alignr${top cpu 3}
${color #ffd700}${stippled_hr 1}$color
${font Microsoft YaHei:pixelsize=12}
${color #00ff1e}SAM: $mem $alignr${color #db7093}$memperc%
${color #78af78}${membar 8}
${color #00ff1e}SWAP: $swap $alignr ${color #db7093}$swapperc%
${color #78af78}${swapbar 8}
${color #00ff1e}内存占用: $alignr MEM%
${color #ddaa00} ${top_mem name 1}$alignr ${top_mem mem 1}
${color lightgrey} ${top_mem name 2}$alignr ${top_mem mem 2}
${color lightgrey} ${top_mem name 3}$alignr ${top_mem mem 3}
${color #ffd700}${stippled_hr 1}$color
${font Microsoft YaHei:pixelsize=12}
${color #00ff1e}硬盘读取速度:${alignr}${diskio_read}
${color #00ff1e}硬盘写入速度:${alignr}${diskio_write}
${font Microsoft YaHei:pixelsize=12}
${color #00ff1e}/ 分区: ${color}${alignr}${fs_used /}/ ${fs_size /}
${color #78af78}${fs_bar 8 /}
${color #00ff1e}/boot 分区: ${color}${alignr}${fs_used /boot}/ ${fs_size /boot}
${color #78af78}${fs_bar 8 /boot}
${color #00ff1e}/home 分区: ${color}${alignr}${fs_used /home}/ ${fs_size /home}
${color #78af78}${fs_bar 8 /home}
${color #ffd700}${stippled_hr 1}$color
${font Microsoft YaHei:pixelsize=12}
${color #00ff1e}网络 $alignr ${color #00ff1e}IP地址: ${color DDAA00}${addr wlp2s0}
${voffset 1}${color #98c2c7} 上传: ${color #db7093}${upspeed wlp2s0}/s ${alignr}${color #98c2c7}总共: ${color #db7093}${totalup wlp2s0}
${voffset 1}${color #98c2c7} 下载: ${color #ddaa00}${downspeed wlp2s0}/s ${alignr}${color #98c2c7}总共: ${color #ddaa00}${totaldown wlp2s0}
${font Microsoft YaHei:pixelsize=12}
${color #ffa200}${hr 2}
# Various images including the icons of the forecast #
\
${image ~/.conky/images/pressure.png -p 214,20 -s 16x16}\
${image ~/.conky/images/humidity.png -p 214,40 -s 16x16}\
${image ~/.conky/images/wind.png -p 214,60 -s 16x16}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==1').png ~/.cache/weather-1.png}${image ~/.cache/weather-1.png -p 41,120 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==2').png ~/.cache/weather-2.png}${image ~/.cache/weather-2.png -p 119,120 -s 32x32}\
${execi 300 cp -f ~/.conky/icons/$(grep "yweather:forecast" ~/.cache/weather.xml | grep -o "code=\"[^\"]*\"" | grep -o "\"[^\"]*\"" | grep -o "[^\"]*" | awk 'NR==3').png ~/.cache/weather-3.png}${image ~/.cache/weather-3.png -p 195,120 -s 32x32}${font}\