[SOLVED] Can someone please tell me where to find the Desktop Environment name and version?

Add functionality to your desktop
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
User avatar
Doruletz
Level 4
Level 4
Posts: 329
Joined: Sun Aug 15, 2010 1:00 am
Location: USA

[SOLVED] Can someone please tell me where to find the Desktop Environment name and version?

Post by Doruletz »

I already know that you can find the Distro name in "/etc/lsb-release"

Example, in my case:

Code: Select all

"/etc/lsb-release"

DISTRIB_ID=LinuxMint
DISTRIB_RELEASE=19
DISTRIB_CODENAME=tara
DISTRIB_DESCRIPTION="Linux Mint 19 Tara"
But can someone please tell me where to find the Desktop Environment name and version???

(such as "MATE 1.20.1" or "CINNAMON 4.4.8")

It is already displayed in the first TAB of the MATE System Monitor, see snapshot in link bellow...

https://www.dropbox.com/s/oljo1oc6c64s7 ... 2.png?dl=0

Image

I need that for a Conky I'm making...

Thanks.

P.S. - And if you really wanna help, maybe you take the time to post the "GREP" command in your reply...
😂😂🤣🤣😂😂

I am not yet that proficient, I mean I can most likely figure it out on my own, but it takes a long damn while...
Just like it took me a while to come up with this, for the Distro Name:

Code: Select all

cat /etc/lsb-release | grep "DISTRIB_DESCRIPTION=" > $HOME/.Conky/01-MY-SYSTEM-CONKY/linux-version.txt | sed -i -e 's/^.*DISTRIB_DESCRIPTION="//g' -e 's/".*$//g' $HOME/.Conky/01-MY-SYSTEM-CONKY/linux-version.txt
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
What do I think about Window$??? Just take a look at my AVATAR...
User avatar
MrEen
Level 23
Level 23
Posts: 18343
Joined: Mon Jun 12, 2017 8:39 pm

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by MrEen »

How's this:

Code: Select all

inxi -S | grep -o "Desktop:.*"
User avatar
zcot
Level 9
Level 9
Posts: 2833
Joined: Wed Oct 19, 2016 6:08 pm

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by zcot »

I'll throw in too.

Good job Doruletz, in working your way through it, but also, you can take it further(or less, if you know what I mean). ;)

MrEen's solution is good. A minimal amount of processing would probably be the goal so that works nicely.


Here's two examples I came up with by using the search term "grep return text after match". These always produce great returns, and you can hone the search term as you see the types of results you are getting(or not getting). I find myself searching first then realizing I didn't use a great choice of terms but I can get there eventually.
I used grep because you mentioned it, but another good search might be "bash return text after match".

anyway:

Code: Select all

cat /etc/lsb-release | sed -n -e 's/^.*DISTRIB_DESCRIPTION=//p'
and:

Code: Select all

awk -F"TION=" '/DISTRIB_DESCRIPTION=/{print $2}' /etc/lsb-release
although both return the enclosed quotes.

But it's a good exploration to go searching and learn more about the possibilities.


Also, found one from some previous testing on here(I went looking to test the timing of these different options), probably from someone else's post about it. ;)
you can test in terminal:

Code: Select all

lsb_release -d | awk '/Description:/ {print $2,$3,$4,$5}'
and in the conky config:

Code: Select all

${exec lsb_release -d | awk '/Description:/ {print $2,$3,$4,$5}'}
But check in terminal: lsb_release --help and the print $variables could pull out each individual space-separated piece of info as needed. $2-$5 was needed using the -d parameter, and $1 was not used because it was the label for that info. (see: lsb_release -d )

In the end if you could come up with a quick result using the least amount of processing that's good, being that a typical config might be a string of processing commands after processing commands. And also, using conky, if you can get an opportunity to use the $no_update variable, for data that is not changed during the running of the config, that's even better! (well but you have to use existing conky-provided variables/objects which there is not one for this data)


Extra credit. I used a lua timing function to test each of these. And in the end they are all coming out so similarly, and they do each vary a bit during each pass, but they were all almost equal overall.

I removed the passes where they all had exactly the same timing, I let it run about 10 passes.

elapsed time 1: 0.000005
elapsed time 2: 0.000004
elapsed time 3: 0.000005
elapsed time 4: 0.000005

elapsed time 1: 0.000004
elapsed time 2: 0.000009
elapsed time 3: 0.000004
elapsed time 4: 0.000005

elapsed time 1: 0.000005
elapsed time 2: 0.000004
elapsed time 3: 0.000004
elapsed time 4: 0.000004

elapsed time 1: 0.000008
elapsed time 2: 0.000007
elapsed time 3: 0.000007
elapsed time 4: 0.000008

I guess #3 looks the best though.

Code: Select all

${lua conky_time_start}\
${exec cat /etc/lsb-release | sed -n -e 's/^.*DISTRIB_DESCRIPTION=//p'}
${lua conky_time_stop 1}
${lua conky_time_start}\
${exec awk -F"TION=" '/DISTRIB_DESCRIPTION=/{print $2}' /etc/lsb-release}
${lua conky_time_stop 2}
${lua conky_time_start}\
${exec lsb_release -d | awk '/Description:/ {print $2,$3,$4,$5}'}
${lua conky_time_stop 3}
${lua conky_time_start}\
${exec inxi -S | grep -o "Desktop:.*"}
${lua conky_time_stop 4}
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by smurphos »

From my conky

Code: Select all

steve@steve-Inspiron-5580:~$ bash -c 'source /etc/os-release; echo "$PRETTY_NAME - $(cinnamon --version)"'
Linux Mint 19.3 - Cinnamon 4.4.8
Alternatively

Code: Select all

steve@steve-Inspiron-5580:~$ bash -c 'source /etc/os-release; echo "$NAME $VERSION - $(cinnamon --version)"'
Linux Mint 19.3 (Tricia) - Cinnamon 4.4.8
Image
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
User avatar
Gruppo Sportivo
Level 4
Level 4
Posts: 276
Joined: Sun May 28, 2017 4:14 am
Location: 🇳🇱

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by Gruppo Sportivo »

Out of my conky configuration
OS

Code: Select all

OS: $alignr${execi 3600 lsb_release -d -s}
Cinnamon

Code: Select all

Cinnamon Versie: $alignr${execi 3600 cinnamon --version}
Nemo

Code: Select all

Nemo Versie: $alignr${execi 3600 nemo --version}
Firefox

Code: Select all

Firefox Versie: $alignr${execi 3600 firefox --version}
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by smurphos »

For MATE to get the version use

Code: Select all

steve@steve-VirtualBox:~$ mate-about --version
MATE Desktop Environment 1.22.2
The XFCE equivalents are a bit wordy so will need some post processing

Code: Select all

steve@steve-VirtualBox:~$ xfdesktop --version
This is xfdesktop version 4.14.1, running on Xfce 4.14.
Built with GTK+ 3.22.30, linked with GTK+ 3.22.30.
Build options:
    Desktop Menu:        enabled
    Desktop Icons:       enabled
    Desktop File Icons:  enabled
steve@steve-VirtualBox:~$ xfwm4 --version
	This is xfwm4 version 4.14.0 (revision ed87ef663) for Xfce 4.14
	Released under the terms of the GNU General Public License.
	Compiled against GTK+-3.22.30, using GTK+-3.22.30.

	Build configuration and supported features:
	- Startup notification support:                 Yes
	- XSync support:                                Yes
	- Render support:                               Yes
	- Xrandr support:                               Yes
	- Xpresent support:                             Yes
	- Embedded compositor:                          Yes
	- Epoxy support:                                Yes
	- KDE systray proxy (deprecated):               No
steve@steve-VirtualBox:~$ xfce4-panel --version
xfce4-panel 4.14.1 (Xfce 4.14)

Copyright (c) 2004-2011
	The Xfce development team. All rights reserved.

Please report bugs to <http://bugzilla.xfce.org/>.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
cliffcoggin
Level 8
Level 8
Posts: 2297
Joined: Sat Sep 17, 2016 6:40 pm
Location: England

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by cliffcoggin »

Menu>System Info.
Cliff Coggin
User avatar
Doruletz
Level 4
Level 4
Posts: 329
Joined: Sun Aug 15, 2010 1:00 am
Location: USA

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by Doruletz »

Gruppo Sportivo wrote: Sun Apr 12, 2020 1:22 am Out of my conky configuration
OS

Code: Select all

OS: $alignr${execi 3600 lsb_release -d -s}
Cinnamon

Code: Select all

Cinnamon Versie: $alignr${execi 3600 cinnamon --version}
Nemo

Code: Select all

Nemo Versie: $alignr${execi 3600 nemo --version}
Firefox

Code: Select all

Firefox Versie: $alignr${execi 3600 firefox --version}
I use MATE, not cinnamon, so this does not help me, but thanks anyway for your time and effort.
What do I think about Window$??? Just take a look at my AVATAR...
User avatar
Doruletz
Level 4
Level 4
Posts: 329
Joined: Sun Aug 15, 2010 1:00 am
Location: USA

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by Doruletz »

smurphos wrote: Sun Apr 12, 2020 1:52 am For MATE to get the version use

Code: Select all

steve@steve-VirtualBox:~$ mate-about --version
MATE Desktop Environment 1.22.2
@smurphos:
FINALLY:
We have a winner !!!
Thanks, buddy.

Code: Select all

dorumint19@Blue-Sentey-PC:~$ mate-about --version
MATE Desktop Environment 1.22.2
What do I think about Window$??? Just take a look at my AVATAR...
User avatar
Doruletz
Level 4
Level 4
Posts: 329
Joined: Sun Aug 15, 2010 1:00 am
Location: USA

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by Doruletz »

cliffcoggin wrote: Sun Apr 12, 2020 8:55 am Menu>System Info.
Buddy, I like your subtle sense of humor...
First of all, this was for use in a Conky script, also there is no "System Info" in my MATE Menu.
What do I think about Window$??? Just take a look at my AVATAR...
User avatar
Doruletz
Level 4
Level 4
Posts: 329
Joined: Sun Aug 15, 2010 1:00 am
Location: USA

Re: Can someone please tell me where to find the Desktop Environment name and version?

Post by Doruletz »

MrEen wrote: Sat Apr 11, 2020 8:22 pm How's this:

Code: Select all

inxi -S | grep -o "Desktop:.*"
@MrEen:
Not bad, but it gives me the whole thing, anyway to make it grep just the MATE Version?

Code: Select all

$ inxi -S | grep -o "Desktop:.*"
Desktop: MATE 1.22.2 Distro: Linux Mint 19.3 Tricia 
Well, I guess I could use this as well, and get everything in one line...
What do I think about Window$??? Just take a look at my AVATAR...
Locked

Return to “Compiz, Conky, Docks & Widgets”