我一直在尝试不同的 Linux 发行版选项,Conky 似乎在它们之间有一些不同的配置。因此,虽然这个conky.conf
文件以前可以工作,但现在不再起作用了。问题似乎是colorN
预定义颜色并在以后使用它们的选项。我猜我正确地定义了它们,但也许它们的调用方式是错误的?下面是我的conky.conf
文件。我的 Conky 版本是 1.10.1。
conky.config = {
background = false,
update_interval = 3.0,
cpu_avg_samples = 2,
net_avg_samples = 2,
override_utf8_locale = true,
no_buffers = true,
out_to_console = false,
out_to_stderr = false,
own_window = true,
own_window_class = 'Conky',
own_window_type = 'dock',
alignment = 'top_right',
border_width = 1,
gap_x = 0,
gap_y = 25,
minimum_height = 5,
minimum_width = 5,
draw_borders = false,
draw_graph_borders = true,
draw_outline = false,
draw_shades = false,
use_xft = true,
font = 'DejaVu Sans Mono:size=12',
extra_newline = false,
uppercase = false,
use_spacer = 'none',
default_color = 333333,
color0 = ff3333,
color1 = 818181
}
conky.text = [[
${font Roboto:bold:size=10}${color0}SYSTEM INFO ${color1} ${hr 2}
${font Roboto:bold:size=8}${goto 95}${color1}Uptime ${alignr 0}${color1} ${uptime_short}
${font Roboto:bold:size=8}${goto 95}${color1}Hostname ${alignr} ${nodename}
${font Roboto:bold:size=8}${goto 95}${color1}Kernel ${alignr} $kernel
${font Roboto:bold:size=8}${goto 95}${color1}Network ${alignr} ${addr eno1}
${font Roboto:bold:size=8}${goto 95}${color1}Distribution ${alignr} ${execi 60 lsb_release -d | cut -f 2| tr "[:upper:]" "[:lower:]"}
${font Roboto:bold:size=8}${goto 95}${color1}CPU ${alignr 0}${color1}${execi 1000 cat /proc/cpuinfo | grep 'model name' | sed -e 's/model name.*: //'| uniq | cut -c 9-26} ${freq_g cpu0}Ghz
${font Roboto:bold:size=10}${color0}Memmory${color1} ${hr 2}
${font Roboto:bold:size=8}${goto 95}${color1}RAM ${goto 220}$mem / $memmax $alignr $memperc%
${goto 95}$membar
${font Roboto:bold:size=10}${color0}HDD${color1} ${hr 2}
${font Roboto:bold:size=8}${goto 95}${color1}File systems ${goto 220} ${fs_used /} / ${fs_size /} $alignr ${fs_free_perc /}%
${goto 95}${fs_bar /}
${font Roboto:bold:size=8}${goto 95}${color1} File Storage ${goto 220} ${fs_used /var/store/files} / ${fs_size /var/store/files} $alignr ${fs_free_perc /var/store/files}%
${goto 95}${fs_bar /var/store/files/}
${font Roboto:bold:size=10}${color0} Processes ${color1} ${hr 2}
${font Roboto:bold:size=8} ${goto 95} ${color1} NAME ${goto 200 } PID ${goto 250 } CPU% ${goto 300 } MEM%
${font Roboto:bold:size=8} ${goto 95} ${top name 1} ${goto 200} ${top pid 1} ${goto 250} ${top cpu 1} ${goto 300} ${top mem 1}
${font Roboto:bold:size=8} ${goto 95} ${top name 2} ${goto 200} ${top pid 2} ${goto 250} ${top cpu 2} ${goto 300} ${top mem 2}
${font Roboto:bold:size=8} ${goto 95} ${top name 3} ${goto 200} ${top pid 3} ${goto 250} ${top cpu 3} ${goto 300} ${top mem 3}
${font Roboto:bold:size=8} ${goto 95} ${top name 4} ${goto 200} ${top pid 4} ${goto 250} ${top cpu 4} ${goto 300} ${top mem 4}
${font Roboto:bold:size=8} ${goto 95} ${top name 5} ${goto 200} ${top pid 5} ${goto 250} ${top cpu 5} ${goto 300} ${top mem 5}
${font Roboto:bold:size=8} ${goto 95} ${top name 6} ${goto 200} ${top pid 6} ${goto 250} ${top cpu 6} ${goto 300} ${top mem 6}
]]