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.27k stars 620 forks source link

[Bug]: Unable to display a static image on KDE Plasma Desktop (X11) #1511

Closed carpii closed 1 year ago

carpii commented 1 year ago

What happened?

I'm trying to display a static JPG or PNG on my KDE desktop, but conky just shows a tiny box with a white border on my desktop instead...

Source image is this..

Conky displays this...

I've tried almost every config change I can think of (including using dock, desktop, normal etc) and come to the conclusion it may be a Conky or KDE

Especially as this was working great under xfce desktop with similar config

I'm using Arch Linux, with conky installed from https://archlinux.org/packages/extra/x86_64/conky/

conky --version shows it has been compiled with Imlib2 support

quick way to test this on KDE...
# grab $HOME/duck.png
wget https://user-images.githubusercontent.com/421266/232929294-743e18f8-a68b-4829-be68-f087037f9ead.png -O $HOME/duck.png

# grab $HOME/test_png.conkyrc (same config as pasted below)
wget https://gist.githubusercontent.com/carpii/706d2891d73875e7e07c5d2ebc69da81/raw/5c454596b79ffb0f3d506b071b2797f3fa73fd4b/conky_testimg.conkyrc -O $HOME/test_png.conkyrc

# spawn conky 
conky --daemonize -c "$HOME/test_png.conkyrc"
# kill conky
`ps aux | grep 'conky --daemonize' | grep "test_png" | tr -s ' ' | cut -d" " -f2 | xargs kill`

Version

conky 1.19.1_pre compiled 2023-04-15 for Linux x86_64

Which OS/distro are you seeing the problem on?

Arch Linux

Conky config

conky.config = {
  background = true,
  use_xft = true,
  --xftfont 123:size=8,
  --xftalpha = 1.0,

  own_window = true,
  own_window_class = 'Conky',
  own_window_hints = 'undecorated,below,sticky,skip_taskbar,skip_pager',
  own_window_type = 'dock',
  own_window_colour = 'FF0000',
  own_window_transparent = true,
  own_window_argb_visual = true,
  own_window_argb_value = 0,

  draw_borders = true,
  gap_x = 800,
  gap_y = 800
}

conky.text = [[
  ${image ~/duck.png -p 800,800 -n -s 480x270}
]]

Stack trace

No response

Relevant log output

No response

laufbrkajc commented 1 year ago

Hi, I did some experimenting here and found 2 things that were preventing the displaying of the image. The position argument passed to the 'image' variable is relative to the conky window, so defining 800,800 in 'conky.config' and then 800,800 'image', makes conky show the image at 1600,1600 on the screen. Also, apparently, conky does not resize its window to the image, so setting an image as the only content makes conky draw the minimum screen possible. You can get around that defining 'minimum_width' and 'minimum_height' in 'conky.config'.

I'm on openSUSE Tumbleweed 20230727, KDE Plasma: 5.27.6, KDE Frameworks: 5.108.0, Qt Version: 5.15.10, Conky: 1.13.1. And also confirmed this on Conky: 1.18.0.

carpii commented 1 year ago

Awesome work, thanks so much :-)