conky中如何设置图表的边框颜色

conky中如何设置图表的边框颜色

我试图在 conky cpu 图中将边框颜色设置为灰色,但我不知道如何执行此操作以及如何指定颜色,我做得不对。使用以下内容(我为边框设置的颜色是color2)仅给出浅蓝色边框,就好像有透明度一样:

conky.config = {
    -- constants
    color0 = 'grey',
    color1 = 'lightgrey',
    color2 = '888888',

    -- stdout
    extra_newline = false,
    out_to_console = false,
    out_to_stderr = false,

    -- window
    own_window = true,
    own_window_type = 'desktop',
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    own_window_argb_visual = true,
    own_window_argb_value = 0,
    background = true,
    double_buffer = true,

    -- window style
    alignment = 'top_right',
    gap_x = 30,
    gap_y = 30,
    border_width = 1,
    minimum_width = 5, minimum_height = 5,

    -- style
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    use_xft = true,
    font = 'DejaVu Sans Mono:size=12',
    stippled_borders = 0,
    uppercase = false,
    use_spacer = 'none',
    show_graph_scale = false,
    show_graph_range = false,

    -- data
    cpu_avg_samples = 2,
    net_avg_samples = 2,
    update_interval = 1.0,
    no_buffers = true,

    -- pad so the boxes don't shift around
    use_spacer = 'left',
    pad_percents = 3,
};

conky.text = [[
$color $nodename - $sysname $kernel - $machine
$hr
${color0}Uptime:$color $uptime_short
${color0}Frequency:$color ${freq_g}GHz
${color0}Processes:$color $processes ${alignr}${color0}Running:$color $running_processes
${color0}CPU:${cpu}%
${color1}CPU1${color}${cpu cpu1}% ${cpubar cpu1 12,115} ${alignr}${color1}CPU5${color}${cpu cpu5}% ${cpubar cpu5 12,115}
${color1}CPU2${color}${cpu cpu2}% ${cpubar cpu2 12,115} ${alignr}${color1}CPU6${color}${cpu cpu6}% ${cpubar cpu6 12,115}
${color1}CPU3${color}${cpu cpu3}% ${cpubar cpu3 12,115} ${alignr}${color1}CPU7${color}${cpu cpu7}% ${cpubar cpu7 12,115}
${color1}CPU4${color}${cpu cpu4}% ${cpubar cpu4 12,115} ${alignr}${color1}CPU8${color}${cpu cpu8}% ${cpubar cpu8 12,115}
${color0}RAM: ${alignr}$color $mem/$memmax = $memperc%
${color0}Swap:${alignr}$color $swap/$swapmax = $swapperc%
${color2}${cpugraph 60,205 00B706 FF0000 -t}${alignr}${memgraph 60,205 00AFB7 FF0000 -t}
${color0}Name                     PID   CPU%   MEM%
${color1}${top name 1}       ${top pid 1} ${top cpu 1} ${top mem 1}
${color1}${top name 2}       ${top pid 2} ${top cpu 2} ${top mem 2}
${color1}${top name 3}       ${top pid 3} ${top cpu 3} ${top mem 3}
${color1}${top name 4}       ${top pid 4} ${top cpu 4} ${top mem 4}
${color1}${top name 5}       ${top pid 5} ${top cpu 5} ${top mem 5}
$hr
${color0}File systems:
${color1}arch (${fs_type /}) ${color}${alignr}${fs_used /} + ${fs_free /}
${color}${fs_size /} ${fs_bar 4 /}
${color1}raid (${fs_type /mnt/raid/}) ${color}${alignr}${fs_used /mnt/raid/} + ${fs_free /mnt/raid/}
${color}${fs_size /mnt/raid/} $color${fs_bar 4 /mnt/raid/}
$hr
${color0}Public IP${color0}${alignr}${execi 3600 dig @resolver1.opendns.com ANY myip.opendns.com +short}
${color0}Net Down:   ${color} ${downspeed ens192} ${alignr}${color0}Net Up:     ${color} ${upspeed ens192}
${color0}Total Down: ${color} ${totaldown ens192} ${alignr}${color0}Total Up:   ${color} ${totalup ens192}
${color2}${downspeedgraph ens192 60,205 00B706 FF0000 -t}${alignr}${upspeedgraph ens192 60,205 00AFB7 FF0000 -t}
]];

答案1

将您的代码复制并粘贴到 my 中conky,边框工作正常,但没有透明度。

改变

own_window_type = 'desktop',

own_window_type = 'Conky', 

并添加

own_window_transparency= true, 

似乎工作正常!

OP康基

在图形之前调用 ${color1} 的地方,使用的颜色不是“default_color”,而是调用的值

改变你的线路

${color2}${downspeedgraph ens192 60,205 00B706 FF0000 -t}${alignr}${upspeedgraph ens192 60,205 00AFB7 FF0000 -t} 

${color}${downspeedgraph ens192 60,205 00B706 FF0000 -t}${alignr}${upspeedgraph ens192 60,205 00AFB7 FF0000 -t}

default_color = 'red',

给出

在此输入图像描述

相关内容