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

[Bug]: cairo_xlib_surface_create nil value error with Lua Cairo #1978

Closed ghost closed 4 months ago

ghost commented 4 months ago

What happened?

attempt to call a nil value (global 'cairo_xlib_surface_create') in conky when compiled with lua-cairo and lua-cairo-xlib

Command to compile: cmake -S . -B build --fresh -DBUILD_X11=ON -DBUILD_LUA_CAIRO=ON -DBUILD_LUA_CAIRO_XLIB=ON -DCMAKE_INSTALL_PREFIX=/home/user/.local`` cmake --build build cmake --install build`

The lua cairo script can be found here: https://forums.bunsenlabs.org/viewtopic.php?id=6939

The script was working on a past version of conky I had compiled. Unfortunately I don't have that binary anymore so I'm not sure of the exact version or compile command.

(ignore the curl output in the log, it's from part of my config which gets my ip address)

Version

1.21.3

Which OS/distro are you seeing the problem on?

Arch Linux

Conky config

No response

Stack trace

No response

Relevant log output

conky: desktop window (0x120000d) is subwindow of root window (0x5b5)
conky: window type - desktop
conky: drawing to created window (0x5000002)
conky: drawing to double buffer
conky: FOUND: console
conky: FOUND: ncurses
conky: FOUND: file
conky: FOUND: x11
conky: 'xfce' x11 session running 'XFCE' desktop
conky: llua_do_call: function conky_clock execution failed: /home/user/.config/conky/conky_clock.lua:41: attempt to call a nil value (global 'cairo_xlib_surface_create')
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100    12  100    12    0     0     34      0 --:--:-- --:--:-- --:--:--    34
conky: llua_do_call: function conky_clock execution failed: /home/user/.config/conky/conky_clock.lua:41: attempt to call a nil value (global 'cairo_xlib_surface_create')
conky: llua_do_call: function conky_clock execution failed: /home/user/.config/conky/conky_clock.lua:41: attempt to call a nil value (global 'cairo_xlib_surface_create')
conky: llua_do_call: function conky_clock execution failed: /home/user/.config/conky/conky_clock.lua:41: attempt to call a nil value (global 'cairo_xlib_surface_create')
conky: llua_do_call: function conky_clock execution failed: /home/user/.config/conky/conky_clock.lua:41: attempt to call a nil value (global 'cairo_xlib_surface_create')
conky: llua_do_call: function conky_clock execution failed: /home/user/.config/conky/conky_clock.lua:41: attempt to call a nil value (global 'cairo_xlib_surface_create')
conky: llua_do_call: function conky_clock execution failed: /home/user/.config/conky/conky_clock.lua:41: attempt to call a nil value (global 'cairo_xlib_surface_create')
brndnmtthws commented 4 months ago

Add:

require('cairo_xlib')

https://github.com/brndnmtthws/conky/issues/1867