Distro "pretty name" in conky
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Distro "pretty name" in conky
I'm using Mint 20.1 Xfce, and my conky line is:
Distro: ${alignr} ${distribution}
This displays "Ubuntu"
I would like to have conky display Linux Mint 20.1.
Any help would be appreciated.
Distro: ${alignr} ${distribution}
This displays "Ubuntu"
I would like to have conky display Linux Mint 20.1.
Any help would be appreciated.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Distro "pretty name" in conky
What hostname does the system have, ie, when you open a terminal it will normally show the prompt username@hostname, the hostname being whatever you called the system at installation.
You can easily use the hostname in conky with the line you have edited to show
If you need to edit the hostname to show what you want you will need to edit the two files /etc/hosts and /etc/hostname to show whatever you want, then reboot to get the change to show. Conky will pick up the change immediately if you've already edited the .conkyrc file to nodename instead of distribution.
You could also, of course, just use a text entry in place of the conky variable with the line
You can easily use the hostname in conky with the line you have edited to show
Code: Select all
Distro: ${alignr}$nodename
You could also, of course, just use a text entry in place of the conky variable with the line
Code: Select all
Distro: ${alignr}Linux Mint 20.1
Re: Distro "pretty name" in conky
Well my hostname is something else on my network, and I already have a conky line for that. I know there is a way to accurately display the distro name, (which is not Ubuntu). I'll wait to see if anyone else knows. Thanks.
Re: Distro "pretty name" in conky
The command
which returns "ulyssa" on LM 20.x.
I'm not exactly sure of the conky syntax to display the output of a terminal command (been awhile since I've used it).
lsb_release
will give you what you want. For example, to get the distribution codename, you would use this:
Code: Select all
lsb_release -cs
I'm not exactly sure of the conky syntax to display the output of a terminal command (been awhile since I've used it).
Solved: Distro "pretty name" in conky
Thank-you. Your lsb_release post gave me the clues I needed. I installed lsb from synaptic, then used the following conkhy line:
Distro: ${alignr} ${exec lsb_release -d | cut -c 14-28}
Works great!
Distro: ${alignr} ${exec lsb_release -d | cut -c 14-28}
Works great!
Re: Distro "pretty name" in conky
If you use the -s (or --short) switch, you won't have to use any string cutting. This works on all (4) outputs from
lsb_release
.Re: Distro "pretty name" in conky
Support for "lsb_release -ds":
However strips the nickname. - But in the end it is a matter of taste, which output to prefer: with or without the nickname.
Code: Select all
$ lsb_release -ds
Linux Mint 18.1 Serena
Code: Select all
$ lsb_release -d | cut -c 14-28
Linux Mint 18.1
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
Re: Distro "pretty name" in conky
OK, in this case I would definitely prefer the shorter commandline, in particular, because it will never require changing the hard-coded numbers in any "cut" command.
The people of Alderaan have been bravely fighting back the clone warriors sent out by the unscrupulous Sith Lord Palpatine for 771 days now.
Lifeline
- Gruppo Sportivo
- Level 4
- Posts: 276
- Joined: Sun May 28, 2017 4:14 am
- Location: 🇳🇱
Re: Distro "pretty name" in conky
Use these 2 lines in conky to show version and version name separately
Code: Select all
Version name: $alignr${execi 3600 lsb_release -c -s}
Code: Select all
Version: $alignr${execi 3600 lsb_release -d -s}
Re: Distro "pretty name" in conky
I was just about to suggest that you use
Since this info isn't likely to change very often, it's a bit wasteful to continually execute it every time Conky refreshes.
execi
rather than exec
but @Gruppo beat me to it.Since this info isn't likely to change very often, it's a bit wasteful to continually execute it every time Conky refreshes.
Running Mint 19.3 Cinnamon on an Intel NUC8i5BEH with 16GB RAM and 500GB SSD
Re: Distro "pretty name" in conky
Other way to get this info without lsb_release
Code: Select all
cat /etc/os-release | grep -m 1 'PRETTY_NAME=' | cut -c 13- | sed -e 's/^"//' -e 's/"$//'
Code: Select all
cat /etc/os-release | grep -m 1 'VERSION_CODENAME=' | cut -c 18- | sed -e 's/^"//' -e 's/"$//'
- smurphos
- Level 18
- Posts: 8498
- Joined: Fri Sep 05, 2014 12:18 am
- Location: Irish Brit in Portugal
- Contact:
Re: Distro "pretty name" in conky
I use
Returns the string
Code: Select all
${execi 30000 bash -c 'source /etc/os-release; echo "$NAME $VERSION - $(cinnamon --version)"'}
Linux Mint 20.3 (Una) - Cinnamon 5.2.7
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.