Skip to main content
Topic solved
This topic has been marked as solved and requires no further attention.
Topic: [SOLVED] Conky displays distro name incorrectly (Read 1906 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

[SOLVED] Conky displays distro name incorrectly

I migrated from Arch and since the first Artix reboot conky doesn't display either "Arch Linux" or "Artix Linux" as distribution name.
The exact thing being displayed is "GCC)) #1 SMP PREEMPT Tue,". My guess is that conky reads the distro name from output of some command and its output is now different than it expects, but that doesn't really give me any ground to fix the issue hence I'm posting here. Did anyone else experience this problem? How can I solve it?

Fetch scripts like screenfetch or neofetch get the name "Artix Linux" right, but they probably do it in a different way (yeah Captain Obvious is here)

Re: Conky displays distro name incorrectly

Reply #1
Check this link for more details:
https://github.com/brndnmtthws/conky/blob/11695b076abf72d797879c7c3b16fe89f3b68ca9/src/linux.cc#L2710

To explain a bit, it check it /etc/arch-version exist, if so you are Arch Linux.
Then it parses /proc/version which has this comment
Quote
/* I am assuming the distribution name is the first string in /proc/version
    that:
    - is preceded by a '('
    - starts with a capital
    - is followed by a space and a number
    but i am not sure if this is always true... */

The better option for conky would be to also check and parse /etc/lsb-release


PS: I created an issue for conky to improve this behaviour. https://github.com/brndnmtthws/conky/issues/939

Re: Conky displays distro name incorrectly

Reply #2
Oh, so that's the deal. So the only way to fix that now would be to manually patch and compile conky?

Re: Conky displays distro name incorrectly

Reply #3
Oh, so that's the deal. So the only way to fix that now would be to manually patch and compile conky?
You can do that, the other option is to change /proc/version to match the value which conky expects.

Is there a working patch for conky ?
I have no idea, if you create a patch please send it to conky.

Re: Conky displays distro name incorrectly

Reply #4
I tried doing something but I'm not very experienced in C programming; I managed to get the distribution name from lsb_release and display it but currently it's quite ugly both code-wise and result-wise. I may work on it later. If I manage to get it nice I'll send a PR to conky for sure


Re: Conky displays distro name incorrectly

Reply #6
So much wasted power on nothing.

Re: Conky displays distro name incorrectly

Reply #7
Ok so now I'm just using ${exec lsb_release -ds | tr -d '"' | tr -d '\n'} instead of $distribution (although at this point I could've just as well written "Artix Linux" because assuming there are quotations in the output is pretty Arch/Artix specific anyway)

It works way better than my attempts at invoking the command from inside conky code which spawned like 20+ lsb_release processes for some reason. (perhaps reading /etc/lsb-release directly would be a better option for this)

I think I'm fine with this solution for now.