我在让 Conky 运行并停留在后台时遇到问题。
如果我设置 Conky own_window_type ='desktop'
,它会在其他窗口后面运行,但打开nautilus
会导致它关闭。如果我设置own_window_type ='dock'
它,它不会关闭,但它位于其他窗口前面。
这是我的 conky.conf 文件:
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}
]]
答案1
我使用以下设置为透明窗口,该窗口始终显示并可以被其他窗口覆盖。
own_window = true, own_window_transparent = true, own_window_type = 'normal', own_window_hints = 'undecorated,sticky,below,skip_taskbar,skip_pager', double_buffer = true,
答案2
只需在 conky 窗口旁边显示带有 .conkyrc 的文本编辑器即可。如果您更改设置并保存它们(不要关闭文本编辑器),conky 将在 1-2 秒后显示新设置。因此您可以非常快速地尝试更改的效果。我将从剪切开始:
own_window_class = 'Conky',
如果不起作用,您可以重新粘贴。