Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: downspeedgraph and upspeedgraph require color and width after update #1428

Closed
Syphist opened this issue Feb 25, 2023 · 15 comments · Fixed by #1447
Closed

[Bug]: downspeedgraph and upspeedgraph require color and width after update #1428

Syphist opened this issue Feb 25, 2023 · 15 comments · Fixed by #1447
Labels
bug Bug report or bug fix PR triage Issue that hasn't been verified

Comments

@Syphist
Copy link

Syphist commented Feb 25, 2023

What happened?

After upgrading from 1.17.0 to 1.18.1 through the Arch Linux repos I noticed my downspeedgraph and upspeedgraph objects were throwing errors. Upon digging through documentation and some trial and error I found that I needed to now include the width of the graph and 2 color values.

In my config before the 2 lines were as follows:
${downspeedgraph wlp7s0 80,}
${upspeedgraph wlp7s0 80,}

But now they must be these 2 lines as follows to work like they used to:
${downspeedgraph wlp7s0 80,224 #5498f8 #5498f8}
${upspeedgraph wlp7s0 80,224 #5498f8 #5498f8}

Oddly enough passing only the size of the graph will produce the correct size, and passing only the interface will produce a working graph of said interface, but when both are passed to it I get the following output when running conky in my terminal:

conky: desktop window (1c0001d) is subwindow of root window (6c7)
conky: window type - desktop
conky: drawing to created window (0x5400002)
conky: drawing to double buffer
conky: can't parse X color 'wlp7s0' (6)
conky: can't parse X color '80,' (3)
conky: can't parse X color 'wlp7s0' (6)
conky: can't parse X color '80,' (3)
conky: forked to background, pid is 49288

Also note that when passing only the size 80, will work, but when passing that as the size with the colors as arguments I still get the errors noted above. An example of such would look like:
${downspeedgraph wlp7s0 80, #5498f8 #5498f8}

Hopefully this is enough information to shed some light on the issue. If you need me to test anything else let me know and I will happily mess with my config.

The config I will attach below is my full config that worked in 1.17.0, but does not fully work now.

Version

1.18.1

Which OS/distro are you seeing the problem on?

Arch Linux

Conky config

conky.config = {
background = true,
double_buffer = true,
alignment = 'top_right',
border_width = 1,
cpu_avg_samples = 2,
default_color = 'black',
default_outline_color = 'black',
default_shade_color = 'black',
default_bar_width = 200,
draw_borders = false,
draw_graph_borders = true,
draw_outline = false,
draw_shades = false,
gap_x = 8,
gap_y = 32,
minimum_width = 170,
minimum_height = 0,
net_avg_samples = 2,
no_buffers = true,
out_to_console = false,
out_to_stderr = false,
extra_newline = false,
own_window = true,
own_window_type = 'desktop',
own_window_transparent = false,
own_window_colour = '#000000',
own_window_argb_visual = true,
own_window_argb_value = 180,
own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
stippled_borders = 0,
update_interval = 2.0,
uppercase = false,
use_spacer = 'none',
show_graph_scale = false,
show_graph_range = false,
use_xft = true,
xftalpha = 0.1,
color0 = '#5498f8',
color1 = '#ee7c44',
color2 = '#db4238',
color3 = '#f5683a',
color4 = '#ef4447'
}

conky.text = [[
${voffset 1}$alignc${font DejaVu Sans:size=14}${color1}≻   ${color3}Status   ${color1}≺${font Ubuntu:size=12}
${voffset 12}${color2}OS $alignr ${color0} ${exec lsb_release -d | cut -f 2| tr "[:upper:]" "[:lower:]" | cut -d ' ' -f1-2}
${color2}Kernel $alignr ${color0} $kernel

${color2}CPU ${color0}${alignr}$cpu%
${cpubar cpu1 5,224}
${cpubar cpu2 5,224}
${cpubar cpu3 5,224}
${cpubar cpu4 5,224}
${cpubar cpu5 5,224}
${cpubar cpu6 5,224}
${cpubar cpu7 5,224}
${cpubar cpu8 5,224}
${top name 1} $alignr ${top cpu 1}%
${top name 2} $alignr ${top cpu 2}%
${top name 3} $alignr ${top cpu 3}%
${top name 4} $alignr ${top cpu 4}%
${top name 5} $alignr ${top cpu 5}%
${top name 6} $alignr ${top cpu 6}%

${color2}RAM ${color0}${alignr} $mem / $memmax - $memperc%
${membar 5,224}
${color2}SWAP ${color0}${alignr} $swap / $swapmax - $swapperc%
${swapbar 5,224}
${top_mem name 1} $alignr ${top_mem mem_res 1}
${top_mem name 2} $alignr ${top_mem mem_res 2}
${top_mem name 3} $alignr ${top_mem mem_res 3}
${top_mem name 4} $alignr ${top_mem mem_res 4}
${top_mem name 5} $alignr ${top_mem mem_res 5}
${top_mem name 6} $alignr ${top_mem mem_res 6}

${color2}Temperatures
${color0}Intel i7 4770 $alignr ${exec sensors | grep -E "^Package id 0:" | cut -d ' ' -f 5-5 | cut -d '+' -f 2-}
${color0}AMD RX 6600 $alignr ${exec /home/syphist/.programs/gputemp-conky.sh}

${color2}Download ${color0}${alignr}${downspeedf wlp7s0} KiB/s
${downspeedgraph wlp7s0 80,}
${color2}Upload ${color0}${alignr}${upspeedf wlp7s0} KiB/s 
${upspeedgraph wlp7s0 80,}

${color2}Local IP${color0}${alignr}${addrs wlp7s0}
${color2}Public IP${color0}${alignr}${execi 3600 wget -q -O /dev/stdout http://checkip.dyndns.org/ | cut -d : -f 2- | cut -d \< -f -1}
]]

Stack trace

No response

Relevant log output

No response

@Syphist Syphist added bug Bug report or bug fix PR triage Issue that hasn't been verified labels Feb 25, 2023
@frc-kde
Copy link

frc-kde commented Feb 26, 2023

Same thing here, with:
conky 1.18.1_pre compiled 2023-02-24 for Linux x86_64
in Arch Linux

I had two graphs in the same line:

${downspeedgraph eno1 30,120} $alignr${upspeedgraph eno1 30,120}

and after upgrade to Conky 1.18.1, they became so:

2023-02-26_10-23-44_A-Conky-graph-Ooops_CROP

Adding 2 colours did split them:

${downspeedgraph eno1 30,120 #5498f8 #5498f8} $alignr${upspeedgraph eno1 30,120 #5498f8 #5498f8}

2023-02-26_12-03-34_A_CROP

Also, just removing "eno1", did split the graphs:

${downspeedgraph 30,120} $alignr${upspeedgraph 30,120}
2023-02-26_12-05-57_A_CROP

@shadow-absorber
Copy link

ditto and thanks for this report for a temporary fix by adding colour to the graphs

@jukk4
Copy link

jukk4 commented Feb 27, 2023

I also see this potential regression. And diskiograph, diskiograph_read and diskiograph_write seem to be also affected in the same way.

@napcok
Copy link

napcok commented Feb 27, 2023

Maybe it is a good idea for all graphs to use current_color if gradients colors are not defined? This way older configs will not broke.

@Syphist
Copy link
Author

Syphist commented Feb 27, 2023

Maybe it is a good idea for all graphs to use current_color if gradients colors are not defined? This way older configs will not broke.

That's kind of what I was hoping for. If for some reason that can't be done we should be able to pass colorN as a gradient color too imo. I was never able to figure out how to do that in my work around so I had to "hardcode" the color into the graph.

@napcok
Copy link

napcok commented Mar 3, 2023

Just an idea...
Maybe it would be worth adding global configuration options like:
gradient_color =
gradient_colorTo =

  1. If inline colors are defined - they are used
  2. Else - global configured options used
  3. Else, if global not defined - current color is used

Background...
I'm currently using scripts to colorize Conky based on the colors from the wallpaper I'm currently using. So all my Conkies are recolorized automatically after wallpaper change. This is easy with the existing global configuration options.
If gradient colors can only be defined inline - it will probably become a nightmare to script

@miblodelcarpio
Copy link

@napcok Your idea reminded me that we already have such options for sizing: default_graph_height and default_graph_width. I have these set and they worked before the update but not after. Now I hardcode them in the ${upspeedgraph}/${downspeedgraph} declarations as a workaround.

So with this reminder I tried using variables for the colours, but found they don't work. The "variabled" colour would default to what looks like FF0000. Probably the same colour as the line I get when my sizes aren't set inline.

I wonder, is the problem down to parsing / resolving variables within ${} scopes? This kind of thing has cropped up before, in the incorrect network speed bug: #863 (comment).

@lukefromdc
Copy link

I ran into this too, rolled back to an older version to get out of it. Looks like 1.18.1 is reading other variables withing the graphs as colors and thus failign to parse width, height etc

@lukefromdc
Copy link

Confirm specifying a gradient for all graphs works around this, lets me use 1.1.8.1 but this really should be fixed

@bi4k8
Copy link
Collaborator

bi4k8 commented Mar 4, 2023

This is probably an issue with 5e98c49 incorrectly resolving parse ambiguity now that graphs can use color names like "red". I'll look into it soon.

@madhur
Copy link

madhur commented Mar 5, 2023

I have the same issue

@bi4k8 bi4k8 mentioned this issue Mar 5, 2023
4 tasks
@bi4k8
Copy link
Collaborator

bi4k8 commented Mar 5, 2023

See #1447; reports from testers of whether it fixes this bug would be appreciated.

@jukk4
Copy link

jukk4 commented Mar 6, 2023

See #1447; reports from testers of whether it fixes this bug would be appreciated.

Yes, bug seems to be fixed now. Thanks!

@Syphist
Copy link
Author

Syphist commented Mar 6, 2023

See #1447; reports from testers of whether it fixes this bug would be appreciated.

Yes, bug seems to be fixed now. Thanks!

I just tested this. Compiled from the source on Arch Linux and ran the application that was compiled and it worked as I expected it to. Thanks for your quick response and quick solution. I will look forward to when an official release of this is compiled for Arch Linux in the repos. As decided, the issue should definitely be closed. Thanks again for working on it @bi4k8 .

@lukefromdc
Copy link

lukefromdc commented Mar 7, 2023 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug report or bug fix PR triage Issue that hasn't been verified
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants