Closed mxmlnkn closed 8 months ago
I'm just some random person- but it's possible that your resolution changes in some way after conky is loaded. You could try adding sleep 5; or something before the command in xfce, but I don't know how xfce loads, so that could delay everything instead of just conky. It's also possible to setup a systemctl user service that runs after a delay, or call a script that has a delay, I imagine. Good luck!
Well yes, it actually does work to change conky ...
into bash -c
sleep 0.1s && conky ...`, but I would only call this a workaround, not a solution. Also there are still maybe 10% where it doesn't work, maybe because I didn't set it all the way to 5s. Also I would like to know, what goes wrong here.
I tried rearranging the order in my /etc/xdg/xfce4/xinitrc
, but it seems that something started after this is the underlying cause, because my changes didn't have any effect. Basically I moved the start of autostarts almost to the end and inserted a sleep 1s
before that. If this doesn't work it's something else.
If the order of ps aux
(process id ordered) is at all an indicator of the order processes are started, then the following order works:
/usr/lib/xorg/Xorg -nolisten tcp -auth /var/run/slim.auth
/usr/sbin/ntpd -p /var/run/ntpd.pid -g -c /var/lib/ntp/ntp.conf.dhcp -u 106:114
/bin/sh /etc/xdg/xfce4/xinitrc -- /etc/X11/xinit/xserverrc
/usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager
/usr/bin/dbus-launch --exit-with-session x-session-manager
/usr/bin/dbus-daemon --fork --print-pid 6 --print-address 8 --session
xfce4-session
/usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd
xfwm4
xfce4-panel
Thunar --daemon
xfdesktop
xfsettingsd
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libwhiskermenu.so 5 14680097 whiskermenu Whisker Menu Show a menu to easily access installed applications
/usr/lib/gvfs/gvfsd
conky -c /etc/.conkyrc
/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd
This also works:
/usr/bin/pulseaudio --start --log-target=syslog
/usr/lib/xorg/Xorg -nolisten tcp -auth /var/run/slim.auth
/bin/sh /etc/xdg/xfce4/xinitrc -- /etc/X11/xinit/xserverrc
/usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager
/usr/bin/dbus-launch --exit-with-session x-session-manager
/usr/bin/dbus-daemon --fork --print-pid 6 --print-address 8 --session
xfce4-session
/usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd
xfwm4
xfce4-panel
Thunar --daemon
xfdesktop
xfsettingsd
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libwhiskermenu.so 5 16777249 whiskermenu Whisker Menu Show a menu to easily access installed applications
/usr/lib/gvfs/gvfsd
/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-2.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libpulseaudio-plugin.so 9 16777259 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system
conky -c /etc/Luyomi.conkyrc
/usr/lib/x86_64-linux-gnu/xfce4/panel-plugins/xfce4-xkb-plugin 1 16777260 xkb-plugin Keyboard Layouts Keyboard layouts setup and switch plugin
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libwavelan.so 17 16777261 wavelan Wavelan View the status of a wireless network
But these orders don't
/usr/lib/xorg/Xorg -nolisten tcp -auth /var/run/slim.auth
/bin/sh /etc/xdg/xfce4/xinitrc -- /etc/X11/xinit/xserverrc
/usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager
/usr/bin/dbus-launch --exit-with-session x-session-manager
/usr/bin/dbus-daemon --fork --print-pid 6 --print-address 8 --session
xfce4-session
/usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd
xfwm4
xfce4-panel
Thunar --daemon
xfdesktop
xfsettingsd
conky -c /etc/Luyomi.conkyrc
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libwhiskermenu.so 5 14680097 whiskermenu Whisker Menu Show a menu to easily access installed applications
/usr/lib/gvfs/gvfsd
/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd
/usr/lib/gvfs/gvfs-udisks2-volume-monitor
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-2.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libpulseaudio-plugin.so 9 14680107 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system
/usr/lib/x86_64-linux-gnu/xfce4/panel-plugins/xfce4-xkb-plugin 1 14680108 xkb-plugin Keyboard Layouts Keyboard layouts setup and switch plugin
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libwavelan.so 17 14680109 wavelan Wavelan View the status of a wireless network
and this
/usr/lib/xorg/Xorg -nolisten tcp -auth /var/run/slim.auth
[kworker/2:1]
/bin/sh /etc/xdg/xfce4/xinitrc -- /etc/X11/xinit/xserverrc
/usr/bin/ssh-agent /usr/bin/dbus-launch --exit-with-session x-session-manager
/usr/bin/dbus-launch --exit-with-session x-session-manager
/usr/bin/dbus-daemon --fork --print-pid 6 --print-address 8 --session
xfce4-session
/usr/lib/x86_64-linux-gnu/xfce4/xfconf/xfconfd
xfwm4
xfce4-panel
Thunar --daemon
xfdesktop
xfsettingsd
conky -c /etc/Luyomi.conkyrc
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libwhiskermenu.so 5 18874401 whiskermenu Whisker Menu Show a menu to easily access installed applications
/usr/lib/gvfs/gvfsd
/usr/lib/x86_64-linux-gnu/tumbler-1/tumblerd
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-2.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libpulseaudio-plugin.so 9 18874411 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system
/usr/lib/x86_64-linux-gnu/xfce4/panel-plugins/xfce4-xkb-plugin 1 18874412 xkb-plugin Keyboard Layouts Keyboard layouts setup and switch plugin
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libwavelan.so 17 18874413 wavelan Wavelan View the status of a wireless network
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libsystray.so 6 18874414 systray Notification Area Area where notification icons appear
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/liborageclock.so 18 18874415 xfce4-orageclock-plugin Orage Panel Clock Show time and date?
This seems to indicate, that one of these two are the reason:
/usr/lib/x86_64-linux-gnu/xfce4/panel/wrapper-1.0 /usr/lib/x86_64-linux-gnu/xfce4/panel/plugins/libwhiskermenu.so 5 14680097 whiskermenu Whisker Menu Show a menu to easily access installed applications
/usr/lib/gvfs/gvfsd
I fairly doubt it's gvfsd
, but whiskermenu also doesn't make any sense, meaning ps aux
may not have been the best indicator.
As the problem doesn't appear on consecutive refreshs the bug should be inside some initialization routine of conky.
Btw: Everything, Slim, Virtual terminals, should have 1920x1080 pixel, so I don't think this is a problem with changing resolution.
Hmm~. Personally, I have conky in my i3 startup config with no delays, and it works fine. Does SLIM have the correct resolution and everything? Meaning having it the same as your login. Another possibility I might entertain is that when you load whiskermenu it refreshes the panels, which might potentially change how conky determines screen size and cause some sort of issue. Again, I have no reason to believe that's true, it's just an idea. Another test I might suggest is adding a comment to your conkyrc while conky is in the incorrect mode. If it updates to the correct mode when it automatically reloads itself with the updated config, then I'd say it's an issue with initialization and detecting screen size. If you change the delay to 0.2s does it give you a more consistent result, or is it the same as at 0.1s? Either way, I'm glad my work around did something for you. I'd get annoyed if my conky was acting like yours.
Of all the bugs I encounter daily since switching to Linux, this is one of the least obnoxious ones :). But thank you for your empathy. Other bugs like having to append 'i915.modeset=0' in GRUB every time I boot, or gvfsd-trash
hogging 80% CPU on all cores forever after deleting too many files at a time, e.g. with trash ./*
or Thunar crashing every now and then on cut and pasting files or xfce-session-logout
killing all programs instead of closing them properly, ...
In order to not let this go offtopic I did some tests, too: If I apply the following diff I can reproduce the behavior almost exactly even when it is not in autostarted:
diff --git a/src/fonts.h b/src/fonts.h
index 00b2265..017c4da 100644
--- a/src/fonts.h
+++ b/src/fonts.h
@@ -57,12 +57,13 @@ struct font_list {
#ifdef BUILD_XFT
-#define font_height() (use_xft.get(*state) ? (fonts[selected_font].xftfont->ascent + \
- fonts[selected_font].xftfont->descent) \
- : (fonts[selected_font].font->max_bounds.ascent + \
- fonts[selected_font].font->max_bounds.descent))
-#define font_ascent() (use_xft.get(*state) ? fonts[selected_font].xftfont->ascent \
- : fonts[selected_font].font->max_bounds.ascent)
+/* Changing this to e.g. 10 will only result in smaller conky window, but the
+ * text and graphs are rendered correctly, especially with the correct distance
+ * from each other, meaning only things down will not be displayed ... */
+#define font_height() 11
+/* Changing this to e.g. 8 will affect the spacing between lines. Even if
+ * those lines contain graphs. It's comparable to \baselineskip in LaTeX */
+#define font_ascent() 8
#define font_descent() (use_xft.get(*state) ? fonts[selected_font].xftfont->descent \
: fonts[selected_font].font->max_bounds.descent)
But this is weird, because font_ascent()
is called every drawing cycle inside conky.cc
's draw_each_line_inner
, meaning, I'm not entirely sure why this won't correct after some cycles.
use_xft.get(*state)
is true, so what normally should be returned is fonts[selected_font].xftfont->ascent
, although I need to test what this returns on autostart. xftfont
is set inside load_fonts
inside fonts.cc
. The .font
version is also set by this function, but at the very end.
So I added some debug printfs and I changed my autostart command to bash -c '/opt/conky/build/src/conky -c /etc/.conkyrc 2>&1 > /tmp/conky.log'
Init X11
update_workarea
init_windowupdate_workarea
Init X11
update_workarea
init_windowupdate_workarea
[load_fonts] use_xft.get(*state) == true
[load_fonts] fonts[0].xftfont = XftFontOpenName( display=0xad1700(display_width=1920, display_height=1080), screen=0, fonts[0].name.c_str()=Droid Sans:size=8 );
[load_fonts][a] fonts[0].xftfont->ascent = 9
[main_loop] font_ascent() = 9, font_descent() = 2, font_height() = 11
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[...]
On a manual start the output is this:
Init X11
update_workarea
init_windowupdate_workarea
Init X11
update_workarea
init_windowupdate_workarea
[load_fonts] use_xft.get(*state) == true
[load_fonts] fonts[0].xftfont = XftFontOpenName( display=0x1efa700(display_width=1920, display_height=1080), screen=0, fonts[0].name.c_str()=Droid Sans:size=8 );
[load_fonts][a] fonts[0].xftfont->ascent = 10
[main_loop] font_ascent() = 10, font_descent() = 3, font_height() = 13
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[...]
Actually it turns out load_fonts
is actually called on every draw, I guess by generate_text_internal
in conky.cc
. But load_fonts
checks with if(not fonts[i].xftfont)
if it really has to load the font or not, meaning it is set only on start.
There is no error about "font couldn't be opened". In both cases the font is loaded by the same line:
fonts[i].xftfont = XftFontOpenName(display, screen, fonts[i].name.c_str());
In both cases the parameters given seem to be similar, except the display pointer, but the display size which was returned by that display object is the same,... Still the returned font has a different font_height
. Is this a bug with the X FreeType interface library
?
The display is set by x11.cc
I assume:
static void init_X11()
{
if (!display) {
const std::string &dispstr = display_name.get(*state).c_str();
// passing NULL to XOpenDisplay should open the default display
const char *disp = dispstr.size() ? dispstr.c_str() : NULL;
if ((display = XOpenDisplay(disp)) == NULL) {
throw std::runtime_error(std::string("can't open display: ") + XDisplayName(disp));
}
}
The display pointers changes on every manual start, so I don't think it matters much if they are different.
Looking over everything I could grasp, it seems like something is changing how X FreeType responds to conky in the initial stages of launching. Because with a bit of a delay it does this less often, yes? I'm not sure what distro you're on, or what versions you have. I believe that info is necessary? I believe the latest Conky is around 1.10.1, as that's what I have. I also believe the latest libxft is 2.3.2 . Assuming you have at least those two versions, you might be stuck with a work around until someone patches this bug fix (Unless one of the existing pull requests attempts to fix something that coincidentally fixes this). If you don't have those two, upgrading to them could potentially solve the issue. Particularly with libxft.
I'm not sure what that grub line does, but I've had no such issue. Might be distro specific. You can also just append that line directly to /boot/grub/grub.cfg in the place that looks the same as where you normally add it, then it should show up when you boot, thus preventing you from having to manually append it. I've noticed that as well with thunar, though I haven't had it happen in a while, so it could be fixed at thunar 1.6.10 . I haven't ever used the trash command from terminal before, but tested it just now with about six screenshots, and it was instant, with no real processor usage. I have gvfs 1.26.3 though.
Personally, I use i3wm, and manually close the majority of my programs before shutting down each day, and haven't noticed such an issue. I assume that's for performance, as people would get annoyed if xfce took forever to logout. I might suggest closing them manually, or writing your own script that closes them all, then executes the logout command. I use ArchLinux, so if your versions are drastically different, that's possibly why.
I'll try doing some edits to my conkyrc, test your conky rc file, and see if I get any similar issues at all.
With delay conky works (I currently have 1s delay). I'm using:
sid
, but also some stretch
packages which I didn't get around to updateLinux version 4.4.0-1-amd64 (debian-kernel@lists.debian.org) (gcc version 5.3.1 20160205 (Debian 5.3.1-8) ) #1 SMP Debian 4.4.2-2 (2016-02-19)
xfce 4.12.2
xfwm4 4.12.3-1
libx11-dev:amd64 2:1.6.3-1
conky
b38ab1117e5daab79d3642b2cc85f8a5d48c89f4 which should be almost the latest commitlibxft-dev 2.3.2-1
libxft2 2.3.2-1
thunar 1.6.10-2
compton 0.1~beta2-1
I need this, because without I have terrible screen tearing in firefox. Compton is started with a 5s delay, so it starts after conky. Without compton conky doesn't have transparency for some reason. Killing compton and then starting conky won't result in this font_height
bug. I don't think compton is at fault here.In your config, you have use_xft to true. If you set this to false, can you reproduce the issue? If you can't, that would tell us it has more to do with libxft than anything, yes? I'm running conky as well. I used your config- and except for the fact that it takes forever to get my public ip the first time, and thus doesn't update until it does, it ran fine. I wasn't able to easily replicate the issue. Your versions all seem to be the same or newer- though my kernel is a bit newer, but I don't think that would result in a difference. I'm not sure why you have both libxft-dev and libxft2. Could it be you're running two of them, and you get a different result depending on which one responds? Again, I'm not sure on how that works.
Glad the delay works for you. It might not be relevant, but out of curiosity, what graphics driver are you using? I'm running nvidia, so there could be a difference there as well. Though it'd be kind of odd if that caused it, it doesn't seem impossible to me.
Wow thanks for mentioning of the public IP! I noticed that sometimes conky seemed to never load or takes a very long time. But the bug was so unspecific I couldn't open an issue.
libxft-dev
is just the developer package i.e. the headers, e.g. for compiling conky, and libxft2
is the runtime. E.g. see dpkg -L libxft-dev
and dpkg -L libxft2
With use_xft = false
the bug doesn't appear, good spotting that! But the fonts don't look quite to my liking.
Also I'm using the NVIDIA proprietary drivers:
| NVIDIA-SMI 361.28 Driver Version: 361.28 |
Glad my comment helped. xP
Alright. I only have a singular libxft package, so I wasn't sure. To be fair, I'm also not compiling conky from source.
I agree completely that the fonts aren't nearly as pretty. I tried the option and instantly changed it back. However, that does give us way more certainty that the interaction with xft is the issue.
As your nvidia driver is the same as mine, and I don't experience the issue, I'll say that's not it.
Now, there's a few questions I have. For example: Why does the 1s delay fix the issue? Can you reproduce the bug in another desktop environment? If not, can you reproduce it in the same desktop environment, but with a different window manager? If you set own_window_type = override, can you reproduce the issue in your original desktop environment? That might be easiest to test first, since it requires the least amount of fiddling. As I understand it, it spawns conky outside of the control of your window manager- and if that's somehow influencing the issue, it would tell us so.
I realize these seem pretty irrelevant to the issue we've pinned down, but as the 1s delay helps, it might be worth testing to see if we can find out "why" it helps.
override
doesn't fix the bug, moreover when started manually transparency doesn't work, and if started by autostart, it is shown shortly and I guess after the wallpaper is loaded conky isn't visible anymore, maybe overwritten by the wallpaper ... As I wouldn't use this option anyway, I'm not in the mood to open multiple bugs.
As for the different desktop environments and window managers. I could try this in some days, currently this is too much time.
This 1s offset also intrigued me, that's why I did try to get some info about started process order with ps aux
, but it doesn't seem enough. I also very very shortly tried auditd
as recommend here, but it hogged full CPU and slowed down the start at least hundredfold, I had to deinstal it in a virtual terminal and reboot.
That's interesting. I actually use override, as i3WM otherwise completely fucks conky and makes it into a cute little window that gets in my way. I don't have any issues with transparency, either. Wonder what the difference is. Might be something else in my config.
That's fine, it was just a suggestion worth testing. I'd assume something is being done in the first second, and using a different desktop environment might do it faster, and thus not display the issue. I'm not sure the test will give us any valuable data beyond that, though.
You could try disabling a bunch of other startup stuff, and see if you find something specific. But I believe you mentioned you tried setting conky to start last, and it still had the issue sometimes. I can't think of anything else at the moment. I believe most, if not all, of the information needed to debug the issue should be somewhere in this issue now, though, so hopefully the dev will take a peek.
Good luck with your other bugs!
2 years 6 months passed. Can you determine if you're still having this problem today on 1.10.8
or preferably 1.10.9_pre
(git)? The older versions are not trustworthy due to too many changes that can be hard to track. Thank you.
I think this issue is probably happening to me too (macOS). The weird thing is that if you kill conky and run it again it shows up correctly. (The second time is always correct.)
To make things a bit easier, the diff between @mxmlnkn's debug printfs is...
diff --git a/mx-a b/mx-b
index 93734ea..00c346b 100644
--- a/mx-a
+++ b/mx-b
@@ -5,9 +5,10 @@ Init X11
update_workarea
init_windowupdate_workarea
[load_fonts] use_xft.get(*state) == true
-[load_fonts] fonts[0].xftfont = XftFontOpenName( display=0xad1700(display_width=1920, display_height=1080), screen=0, fonts[0].name.c_str()=Droid Sans:size=8 );
-[load_fonts][a] fonts[0].xftfont->ascent = 9
-[main_loop] font_ascent() = 9, font_descent() = 2, font_height() = 11
+[load_fonts] fonts[0].xftfont = XftFontOpenName( display=0x1efa700(display_width=1920, display_height=1080), screen=0, fonts[0].name.c_str()=Droid Sans:size=8 );
+[load_fonts][a] fonts[0].xftfont->ascent = 10
+[main_loop] font_ascent() = 10, font_descent() = 3, font_height() = 13
+[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
[load_fonts] use_xft.get(*state) == true
Noticing use_xft
in the diff along with font changes... I'm on i3wm
so things may be a bit more consistent than KDE
or XFCE4
. With @mxmlnkn's config out of the box, I had to use use_xft=false
to get the left side or I will always get the right side (which is use_xft=true
). I don't think this changed anything much, but to acknowledge that it might be something wrong with session initialization during session startup.
I wonder what happen when you edit the config to force conky reload, does it give you correct output this time or do we explicitly have to kill it restart conky first?
Hello everyone. Can you try this again on 1.11.0
? This may have been fixed indirectly. Thanks.
The issue still exists on Ubuntu 22.04 with Conky 1.12.2. A sleep in the startup script fixes the font issue.
Yes, interestingly I started seeing this bug after the upgrade from 20.04 to 22.04.
This issue is stale because it has been open 365 days with no activity. Remove stale label or comment, or this issue will be closed in 30 days.
This issue was closed because it has been stalled for 30 days with no activity.
I added conky in
xfce4-session-settings
-> Application Autostart add withconky -c /home/mxmlnkn/etc/conky.conkyrc
When logging in to XFCE using e.g. slim login manager (I think it shouldn't matter), then conky looks different than when starting conky manually with the above command. One frame was made with the autostarted version of conky, which was already running more than a day. The other frame was made 3 seconds later after
pkill conky; conky -c /home/mxmlnkn/etc/conky.conkyrc
.Differences in the manually started version:
fs_bar
statements instead of 0 pixelscpu_graphs
in the CPU-section have a overlap of 4 pixels instead of being a perfect fit (the lower 1px border of the upper graph lies on top of the 1px upper border of the lower graph, resulting in a perfect 1 px border between the two graphs)Also there is something I never noticed, but I guess this is a different bug:
This bug could be related to https://github.com/brndnmtthws/conky/issues/199
This is my conkyrc: