Closed zlice closed 2 months ago
Can you run conky with conky -DD
and provide some logs?
ps -e
shows it's not running?
with debug it looks like it's failing on XrmSetDatabase(display, db);
the comment mentions copying from dunst, which has an updated comment about XrmSetDatabase
docs being inaccurate ? https://github.com/dunst-project/dunst/blob/master/src/x11/x.c#L499
tried double checking prop.value
and a couple things but it's still failing randomly when starting with wm.
sometimes XGetTextProperty
fails and skips all the xrdb destroy/set logic. other times things work and the XrmSetDatabase runs fine? seen elsewhere about XGetTextProperty defaulting to ~/.Xdefaults
if there's no xrdb, but not sure if that's related in any way
l - o - l
i think this works? not entirely sure if it's right, just going with the dunst logic
--- a/src/x11.cc
+++ b/src/x11.cc
@@ -33,6 +33,9 @@
#include "x11.h"
#include <X11/X.h>
+#include <X11/Xlibint.h>
+#undef min
+#undef max
#include <sys/types.h>
#include "common.h"
@@ -314,6 +317,8 @@
XrmDestroyDatabase(db);
}
+ // https://github.com/dunst-project/dunst/blob/master/src/x11/x.c#L499
+ display->db = NULL; // should be new or deleted
db = XrmGetStringDatabase((const char *)prop.value);
XrmSetDatabase(display, db);
}
this has been solid for me for a bit now. should i make a PR or is the patch with the hacky 'undef's enough?
Still does not start for me
:~$ conky -DD
DEBUG(0) [./src/conky.cc:2603]: reading contents from config file '/etc/conky/conky.conf'
conky: Unknown setting 'default_outline_color'
conky: Unknown setting 'gap_x'
conky: Unknown setting 'border_width'
conky: Unknown setting 'show_graph_scale'
conky: Unknown setting 'use_xft'
conky: Unknown setting 'own_window'
conky: Unknown setting 'draw_outline'
conky: Unknown setting 'draw_shades'
conky: Unknown setting 'out_to_x'
conky: Unknown setting 'minimum_width'
conky: Unknown setting 'draw_borders'
conky: Unknown setting 'alignment'
conky: Unknown setting 'default_shade_color'
conky: Unknown setting 'minimum_height'
conky: Unknown setting 'default_color'
conky: Unknown setting 'stippled_borders'
conky: Unknown setting 'show_graph_range'
conky: Unknown setting 'own_window_type'
conky: Unknown setting 'gap_y'
conky: Unknown setting 'double_buffer'
conky: Unknown setting 'draw_graph_borders'
conky: Unknown setting 'own_window_class'
conky: Unknown setting 'font'
DEBUG(1) [./src/core.cc:2059]: no templates to replace
DEBUG(1) [./src/core.cc:2059]: no templates to replace
conky: unknown variable '$hr'
DEBUG(1) [./src/core.cc:689]: Adding $cpu for CPU 0
DEBUG(1) [./src/core.cc:703]: Adding $cpubar for CPU 0
conky: unknown variable '$hr'
conky: unknown variable '$hr'
@zlice undef
s are perfectly fine if definitions leaked from X11 headers cause issues with conky code (like it would be the case for min
and max
). But it looks like it's enough to only add:
display->db = nullptr;
I'm guessing min
and max
are defined in <X11/Xlibint.h>
which you don't seem to use in changed code.
In any case, a PR would be very welcomed. Thank you for the effort debugging this.
When I don't have the header I get an incomplete type
error. Maybe that's a void-linux/compiler thing?
I'll make a PR in the morning. Thanks
/usr/bin/g++ -D_LARGEFILE64_SOURCE -D_POSIX_C_SOURCE=200809L -I/builddir/conky-1.21.4/3rdparty/toluapp/include -I/builddir/conky-1.21.4/build -I/usr/include/freetype2 -I/usr/include/lua5.3 -I/usr/include/libxml2 -I/builddir/conky-1.21.4/3rdparty/Vc -I/builddir/conky-1.21.4/build/src -I/builddir/conky-1.21.4/build/data -DNDEBUG -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -ffile-prefix-map=/builddir/conky-1.21.4/build=. -std=c++17 -Werror -MD -MT src/CMakeFiles/conky_core.dir/x11.cc.o -MF src/CMakeFiles/conky_core.dir/x11.cc.o.d -o src/CMakeFiles/conky_core.dir/x11.cc.o -c /builddir/conky-1.21.4/src/x11.cc
/builddir/conky-1.21.4/src/x11.cc: In function 'void update_x11_resource_db(bool)':
/builddir/conky-1.21.4/src/x11.cc:317:12: error: invalid use of incomplete type 'Display'
317 | display->db = NULL; // should be new or deleted
| ^~
In file included from /builddir/conky-1.21.4/src/x11.h:37,
from /builddir/conky-1.21.4/src/x11.cc:33:
/usr/include/X11/Xlib.h:251:8: note: forward declaration of 'Display'
251 | struct _XDisplay; /* Forward declare before use for C++ */
| ^~~~~~~~~
What happened?
Putting conky in my fluxbox(fork, shynebox) startup file has worked fine for years. But with 1.21 my distro update to the other day it is very finicky if it will start at all. Starting manually in a terminal will start conky with some delay and then run fine until reboot/re-login.
1.19.6 started every time, so I went back to that.
Version
1.21.1
Which OS/distro are you seeing the problem on?
Linux (other)
Conky config