brndnmtthws / conky

Light-weight system monitor for X, Wayland (sort of), and other things, too
https://conky.cc
GNU General Public License v3.0
7.17k stars 615 forks source link

Border_width ignored on top and bottom borders #1951

Closed R0CKH0PP3R closed 2 months ago

R0CKH0PP3R commented 3 months ago

What happened?

Upgraded from v1.19.7 to 1.21.1 on Manjaro and the top and bottom borders are no longer rendered as expected. You can see the differences between the two below, with v1.19.7 on the left: 1 19 71 21 2 I have noticed that 1.21.2 was released earlier today and the appimage for that exhibits the same issue. I also see much talk about dpi & Wayland recently; I'm at 96 dpi on X11 should it matter.

Version

v1.21.1

Which OS/distro are you seeing the problem on?

Linux (other)

Conky config

conky.config = {
    alignment = 'top_right',
    background = true,
    border_width = 5,
    cpu_avg_samples = 2,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_blended = false,
    draw_borders = false,
    draw_graph_borders = true,
    draw_outline = false,
    draw_shades = false,
    extra_newline = false,
    font = 'Hack:size=10',
    gap_x = 25,
    gap_y = 25,
    minimum_height = 5,
    minimum_width = 250,
    maximum_width = 250,
    net_avg_samples = 2,
    no_buffers = true,
    out_to_console = false,
    out_to_ncurses = false,
    out_to_stderr = false,
    out_to_x = true,
    own_window = true,
    own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
    own_window_argb_value = 128,
    own_window_argb_visual = true,
    own_window_class = 'Conky',
    own_window_transparent = false,
    own_window_type = 'normal',
    show_graph_range = false,
    show_graph_scale = false,
    stippled_borders = 0,
    update_interval = 1.0,
    uppercase = false,
    use_spacer = 'none',
    use_xft = true,
}

conky.text = [[
${color white}
${image /tmp/kunst.png -s 250x250 -n}
${voffset 205}
${scroll 33 3 ${mpd_artist} - ${mpd_title}}
${mpd_bar 5, 250}
RAM util:${alignr}$memperc%
CPU util:${alignr}$cpu%
GPU util: ${alignr}${nvidia gpuutil}%
CPU temp:${alignr}${exec sensors | grep Tctl: | cut -c16-17}°C
GPU temp: ${alignr}${nvidia temp}°C
TUN up:${alignr}${upspeed wlp38s0}
TUN down:${alignr}${downspeed wlp38s0}
]]

Stack trace

No response

Relevant log output

No response

Kerion-Nightfall commented 3 months ago

Same Here

Schermata del 2024-06-05 20-42-29 v.1.20.2

Schermata del 2024-06-05 20-43-12 v.1.21.2

Version

v1.21.2

Which OS/distro are you seeing the problem on?

ArchLinux

Conky config

conky.config = {
  background = true,
  alignment = 'bottom_left',
  border_width = 2,
  border_inner_margin = 6,
  border_outer_margin =6,
  default_color = 'bebebe',
  color1 = '1793d1',
  double_buffer = true,
  draw_borders = true,
  draw_shades = false,
  font = 'Cantarell:size=12',
  gap_x = 30,
  gap_y = 30,
  own_window = true,
  own_window_colour = '272727',
  own_window_hints = 'undecorated,skip_taskbar,skip_pager,below',
  use_xft  = true,
}
conky.text = [[
${color1}${alignc}${font ConkySymbols:size=60}t${font}
${color1}${alignc}OS  ${color}${execi 86400 cat /etc/os-release | grep "PRETTY_NAME" | cut -d= -f2 |  sed 's/"//g'}
${color1}${alignc}Kernel  ${color}$kernel on $machine
${color1}${alignc}Aggiornamneti  ${color}${execi 3600 checkupdates | wc -l}
]]

Stack trace

No response

Relevant log output

No response

Caellian commented 3 months ago

Can you try running latest main branch to check whether this is fixed?

R0CKH0PP3R commented 3 months ago

As of commit 12da795, the issue remains.

Caellian commented 3 months ago

Assigning self as I probably broke it in #1862 with changes to src/conky.cc.

alhazacod commented 3 months ago

Im not sure if it's the same issue but it seems pretty close

This is how it should looks like (v1.20.2) image

This is how it looks like in v 1.21.2. The clock is chopped image

And this is how it looks like in v1.21.3 the chopped clock is fixed but it's not centered image

Version

v1.21.2

Which OS/distro are you seeing the problem on?

Arch Linux 6.9.4-arch1-1

Conky config

conky.config = {
--==============================================================================

--  Created : 2022/Jul/19
--  this theme is for conky version 1.10.8 or newer
-- 
--  GRUMIUM2
--  ( A part of Draco Conky themes pack )
--
--  author  : Closebox73
--  license : Distributed under the terms of GPLv3
--  notes   : Created on 1366x768 Monitor

--==============================================================================

  own_window_argb_visual = true,
  own_window_argb_value = 150,
  double_buffer = false,

-- Size and Position settings --
  alignment = 'middle_middle',
  gap_x = 0,
  gap_y = 0,
  maximum_width = 245,
  minimum_height = 245,
  minimum_width = 245,

-- Text settings --
  use_xft = true,
  font = 'Roboto:size=9',

-- Color Settings --
  default_color = 'white',
  default_outline_color = 'white',
  default_shade_color = 'white',
  color1 = '#282C35',

-- Window Settings --
  background = false,
  border_width = 1,
  draw_borders = false,
  draw_graph_borders = false,
  draw_outline = false,
  draw_shades = false,
  own_window = true,
  own_window_colour = '000000',
  own_window_class = 'Conky',
  own_window_argb_visual = false,
  own_window_type = 'desktop',
  own_window_transparent = true,
  own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
  stippled_borders = 0,

-- Others --
  cpu_avg_samples = 2,
  net_avg_samples = 2,
  double_buffer = true,
  out_to_console = false,
  out_to_stderr = false,
  extra_newline = false,
  update_interval = 1,
  uppercase = false,
  use_spacer = 'none',
  show_graph_scale = false,
  show_graph_range = false,
  lua_load = '~/.config/conky/grumimosa/scripts/lua/mini_clock.lua',
  lua_draw_hook_pre = 'main',
}

conky.text = [[
${image ~/.config/conky/grumimosa/res/Circle.png -p 30,30 -s 180x180}\
${alignc 5}${voffset 74}${font Roboto:light:size=11}Current Time
${alignc}${voffset -10}${font Roboto:light:size=45}${time %H:%M}
]]

Stack trace

No response

Relevant log output

No response

virtadpt commented 3 months ago

I'm seeing the same thing here. Conky v1.21.2, Arch Linux up to date as of 14 June 2024, kernel v6.9.4. Also, and I just noticed this, the very last readout in my configuration file is cut off.

-- vim: ts=4 sw=4 noet ai cindent syntax=lua
conky.config = {
    alignment = 'top_right',
    background = false,
    border_width = 5,
    cpu_avg_samples = 10,
    default_bar_height = 15,
    default_color = 'white',
    default_outline_color = 'white',
    default_shade_color = 'white',
    double_buffer = true,
    draw_borders = true,
    draw_graph_borders = false,
    draw_outline = false,
    draw_shades = false,
    use_xft = true,
    font = 'DejaVu Sans Mono:size=12',
    format_human_readable = true,
    gap_x = 10,
    gap_y = 9,
    minimum_height = 10,
    minimum_width = 150,
    net_avg_samples = 10,
    no_buffers = true,
    out_to_console = false,
    out_to_stderr = false,
    extra_newline = false,
    own_window = true,
    own_window_argb_visual = true,
    own_window_argb_value = 125,
    own_window_class = 'Conky',
    own_window_colour = '0a004d',
    own_window_hints = 'skip_taskbar,sticky,undecorated',
    own_window_transparent = true,
    own_window_type = 'normal',
    short_units = true,
    stippled_borders = 0,
    temperature_unit = 'fahrenheit',
    text_buffer_size = 512,
    update_interval = 1.0,
    update_interval_on_battery = 10.0,
    uppercase = false,
    use_spacer = 'none',
    show_graph_scale = false,
    show_graph_range = false
}

conky.text = [[
${alignc 0}${startcase $nodename}
$hr
${alignc 0}${time %A}
${alignc 0}${time %e %B %Y}
${alignc 0}${tztime America/Los_Angeles %R UTC %z}
${alignc 0}${tztime America/New_York %R UTC %z}
${alignc 0}${tztime UTC %R UTC %z}
$hr
Uptime: ${uptime}
$hr
RAM Usage: ${mem}/${memmax}
$hr
CPU Usage: ${cpu}%
0 ${cpubar cpu1 15,100} 7 ${cpubar cpu8 15,100}
1 ${cpubar cpu2 15,100} 8 ${cpubar cpu9 15,100}
2 ${cpubar cpu3 15,100} 9 ${cpubar cpu10 15,100}
3 ${cpubar cpu4 15,100} a ${cpubar cpu11 15,100}
4 ${cpubar cpu5 15,100} b ${cpubar cpu12 15,100}
5 ${cpubar cpu6 15,100} c ${cpubar cpu13 15,100}
6 ${cpubar cpu7 15,100} d ${cpubar cpu14 15,100}
Frequency: ${freq_g} GHz
$hr
Core temp: ${hwmon 5 temp 1}°F
Bus temp:  ${hwmon 3 temp 1}°F
Storage temp:  ${hwmon 2 temp 1}°F
Wifi temp:  ${hwmon 4 temp 1}°F
Fan 0: ${hwmon 3 fan 1} rpm
$hr
File systems:
  /boot ${fs_used /boot}/${fs_size /boot} (${fs_used_perc /boot}%)
  /  ${fs_used /}/${fs_size /} (${fs_used_perc /}%)
$hr
${if_up wlp0s20f3}${alignc 0}wlp0s20f3

 IP: ${addr wlp0s20f3}
 ESSID: ${wireless_essid wlp0s20f3}
 Up: ${upspeed wlp0s20f3}/sec
 Down: ${downspeed wlp0s20f3}/sec
 Speed: ${wireless_bitrate wlp0s20f3}
 Channel: ${wireless_channel wlp0s20f3} (${wireless_freq wlp0s20f3})

$hr${endif}AC adapter: ${acpiacadapter AC} 
Battery status: ${battery_short BAT0}
Battery time: ${battery_time BAT0}
]]
Inc44 commented 3 months ago

The same problem

Conky v1.21.2 linux-lts v6.6.34 Arch Linux of 2024.06.23

conky.config = {
alignment = 'bottom_right',
border_inner_margin = 4,
border_outer_margin = 4,
border_width = 2,
color0 = 'f1eff8',
color1 = 'a0a0c5',
default_color = '666699',
double_buffer = true,
draw_borders = true,
draw_shades = false,
font = 'Noto Sans Mono:style=Medium:size=12',
format_human_readable = true,
gap_x = 18,
gap_y = 18,
imlib_cache_flush_interval = 0,
imlib_cache_size = 0,
out_to_console = false,
out_to_ncurses = false,
out_to_stderr = false,
out_to_wayland = false,
out_to_x = true,
override_utf8_locale = true,
own_window = true,
own_window_transparent = no,
own_window_colour = '292a44',
own_window_type = 'desktop',
update_interval = 1,
use_xft = true,
}
conky.text = [[
${color1}CPU Frequency:     $color0 $freq MHz
${color1}CPU Usage:         $color0 $cpu %
${color1}$hr
${color1}GPU Driver Version: $color0${execpi .001 (nvidia-smi --query-gpu=driver_version --format=csv,noheader)}
${color1}GPU Frequency:      $color0${execpi .001 (nvidia-smi --query-gpu=clocks.sm --format=csv,noheader)}
${color1}GPU Power Usage:    $color0${execpi .001 (nvidia-smi --query-gpu=power.draw --format=csv,noheader)}
${color1}GPU Temp:           $color0${execpi .001 (nvidia-smi --query-gpu=temperature.gpu --format=csv,noheader)}°C
${color1}GPU Usage:          $color0${execpi .001 (nvidia-smi --query-gpu=utilization.gpu --format=csv,noheader)}
${color1}$hr
${color1}RAM Usage:         $color0 $memperc %
${color1}RAM Used:          $color0 $mem
${color1}$hr
${color1}VRAM Frequency:     $color0${execpi .001 (nvidia-smi --query-gpu=clocks.mem --format=csv,noheader)}
${color1}VRAM Usage:         $color0${execpi .001 (nvidia-smi --query-gpu=utilization.memory --format=csv,noheader)}
${color1}VRAM Used:          $color0${execpi .001 (nvidia-smi --query-gpu=memory.used --format=csv,noheader)}
${color1}$hr
${color1}Networking          Used
${color0}Download            $color0${downspeed wlan0}
${color0}Upload              $color0${upspeed wlan0}
${color1}$hr
${color1}Filesystem          Used
${color0}/                   ${fs_used /}
${color0}/home               ${fs_used /home}
${color1}$hr
${color1}Processes:         $color0 $processes $color1
${color1}Running:           $color0 $running_processes
${color1}Uptime:            $color0 $uptime
${color1}$hr
${color1}Name                PID  CPU%  MEM%
${color0}${top name 1}${top pid 1}${top cpu 1}${top mem 1}
${color0}${top name 2}${top pid 2}${top cpu 2}${top mem 2}
${color0}${top name 3}${top pid 3}${top cpu 3}${top mem 3}
${color0}${top name 4}${top pid 4}${top cpu 4}${top mem 4}
]]
Kerion-Nightfall commented 2 months ago

Just tried version 1.21.3 on Arch Linux, still the same issue.

Schermata del 2024-06-30 21-54-14 v.1.21.3

alirezaalavi87 commented 2 months ago

the bottom being clipped looks fixed for me in v1.21.3-pre-9f830224

image

Caellian commented 2 months ago

Can someone try out latest version of the main branch? @agorgl submitted a fix (#1980) which affects text size calculation so it might also be the fix for this issue. If it's fixed we'd create a new version, otherwise I'll look into fixing this before releasing.

rsarson commented 2 months ago

Can someone try out latest version of the main branch? @agorgl submitted a fix (#1980) which affects text size calculation so it might also be the fix for this issue. If it's fixed we'd create a new version, otherwise I'll look into fixing this before releasing.

conky_screenshot

R0CKH0PP3R commented 2 months ago

Just compiled & as of commit 61208fc the issue remains.

virtadpt commented 2 months ago

Just compiled commit 61208fc9fbd0a8e8027b33caad8f5018766437ff. Same thing.

alirezaalavi87 commented 2 months ago

@Caellian I'm on v1.21.3-pre-9f830224 and everything is working ok for me

ghost commented 2 months ago

@Caellian

I've been doing some testing side by side with the latest conky source, and 1.19.7 (which I can confirm doesn't have this bug).

Looking at all the values in this function:

output->draw_rect(text_offset.x() + text_start.x() - offset,
                          text_offset.y() + text_start.y() - offset,
                          text_size.x() + 2 * offset,
                          text_size.y() + 2 * offset);

They are all identical apart from text_start.y() (previously text_start_y), which is (for me) 5 on 1.19.7, and 0 on latest.

Running both versions at the same time, I noticed that the latest version seems to be missing 5 pixels from the top, and 5 from the bottom.

Manually changing text_offset.y() to 5 in that function does add in a border at the top, but not at the bottom.
Notably it also doesn't fix the 10 missing pixels, there are still 5 missing at the top and 5 missing at the bottom.

Update: I think the issue might be with calls to conky::vec2i::uniform. For example in conky.cc (line 908):

int border_total = get_border_total();
text_start = conky::vec2i::uniform(border_total);

The vec text_start will end up as {x:5, y:0}, when in 1.19.7, the equivalent variables text_start_x and text_start_y would both be 5 because of this line:

text_start_x = text_start_y = border_total;

It can be fixed like this: text_start.set_y(text_start.x());

I'm not sure if it's a bug with uniform, as based on the name I would expect it to set both x and y to the same value, but it just sets x to the provided value and y to 0.

There are two places I could find this issue, the other was in display_x11.cc (line 279) with this line:

vec2i border_total = vec2i::uniform(get_border_total());

Which can be fixed in a similar way:

vec2i border_total = vec2i::uniform(get_border_total());
border_total.set_y(border_total.x());

Making these 2 changes seems to fix both the 10 missing pixels, and the borders return to the top and bottom.

Caellian commented 2 months ago

I'm not sure if it's a bug with uniform, as based on the name I would expect it to set both x and y to the same value, but it just sets x to the provided value and y to 0.

Yup, that's the bug. Thank you for debugging this, you've simplified the process on my side 99%.

  static inline vec<T, Length> uniform(T x) {
    return vec<T, Length>(std::array<T, Length>{x});
  }

I incorrectly assumed array constructor to work like vec![value; size] in Rust but it just keeps the remaining Length - 1 values default initialized.

Caellian commented 2 months ago

Everyone do you mind testing the latest main branch? I believe this issue should be resolved. Thanks again @randomcoder67.

git clone https://github.com/brndnmtthws/conky.git conky_test_dir
cd conky_test_dir
cmake -S . -B build
cmake --build build
./build/src/conky

EDIT: updated branch after merging

Caellian commented 2 months ago

Merged the PR into main so clone that branch instead.

I'm re-opening this issue until someone reports it's ok to close.

MeisterP commented 2 months ago

Commit ac25fcce8bb16aadc7a613ac979504e4a51cc639 on top of conky-1.21.4 fixes the issue for me. Thanks.

R0CKH0PP3R commented 2 months ago

I can also confirm that the issue is resolved. Thanks to all involved. :)