2

I'm trying to set the border color to grey in my conky cpu graph, but I can't figure out the way to do this & how the colors are specified, I'm not doing it right. Using the following (the color I set for the border is color2) only gives a light blue border, as if there was transparency:

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}
]];

simonzack
  • 723
  • Please post your entire .conkyrc file so we can reproduce the issue. I'm guessing you have some other transparency rule that is affecting it, but we'd need the whole file to be able to test. – terdon Jun 09 '19 at 13:40
  • @terdon ok sure, done – simonzack Jun 09 '19 at 13:45
  • Thanks. On my system, the border_width directive seems to be ignored, so I can't be sure, but does it work as you want it if you remove the own_window_argb_value = 0 line? – terdon Jun 09 '19 at 14:01
  • @terdon The border_width appears to do nothing on mine too so it doesn't matter. Yes it does for own_window_argb_value, but then conky is no longer transparent. – simonzack Jun 09 '19 at 14:09
  • Yeah, that's what I was afraid of. It's the global transparency that's changing the color you perceive. The fact that it's only an issue for the graph borders suggests this is a bug. :/ – terdon Jun 09 '19 at 14:10
  • @terdon Hmm ok I'll file a bug report for conky then, thanks for looking into it! – simonzack Jun 09 '19 at 14:18
  • It's just the syntax error. See the answer below with the correct use of ${color color2}. – terdon Jun 09 '19 at 15:25

1 Answers1

2

Copying and pasting your code into my conky, the borders worked fine but no transparency.

Changing the

own_window_type = 'desktop',

to

own_window_type = 'Conky', 

and adding

own_window_transparency= true, 

seems to work fine!

OP conky

Where the ${color1} is called ahead of the graph the color used is not 'default_color` but the value called

Changing your line

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

to

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

with

default_color = 'red',

gives

enter image description here

bu5hman
  • 4,756
  • 1
    Yes, but the OP has a ${color} immediately before the graph. – terdon Jun 09 '19 at 14:57
  • Yes I tried default_colour= 'FF0000' and still didn't get it red. – simonzack Jun 09 '19 at 14:59
  • Please include a minimal conkyrc that we can test. At least one of the graph commands. – terdon Jun 09 '19 at 15:08
  • @simonzack hang on, I think it's just a syntax error. You need ${color color2}${cpugraph..., not just ${color2}${cpugraph. bu5hman, if you updated your answer with the relevant (presumably correct) .conkyrc line, then it would probably be perfect. – terdon Jun 09 '19 at 15:12
  • In your screenshot I see a bluish border too, I want to make it grey, any ideas? (maybe I didn't make it clear but this was my original question). – simonzack Jun 10 '19 at 08:38
  • Oh and I just want to change the graph border color, not the text as well. – simonzack Jun 10 '19 at 08:54
  • So set the color tag for the border as the a specific color before the graph and set it back immediately after..... – bu5hman Jun 10 '19 at 15:19