Haggis Veteran Posted November 21, 2012 Veteran Share Posted November 21, 2012 Hey Guys i need as many of these as i can I need to know what $DESKTOP_SESSION shows in the following DE's LXDE XFCE Cinnamon KDE Gnome 2 Gnome 3 and any others you could provide can you paste what yours says and also what DE ur on :) Link to comment Share on other sites More sharing options...
+Majesticmerc MVC Posted November 25, 2012 MVC Share Posted November 25, 2012 [karl@HERA ~]$ echo $DESKTOP_SESSIONxfce[karl@HERA ~]$[/CODE] Arch x64 running XFCE 4.10 Link to comment Share on other sites More sharing options...
Mindovermaster Moderator Posted November 25, 2012 Moderator Share Posted November 25, 2012 david@david-ubuntu:~$ echo $DESKTOP_SESSIONcinnamon[/CODE] Ubuntu 12.10 Cinnamon :) Link to comment Share on other sites More sharing options...
tiagosilva29 Posted November 25, 2012 Share Posted November 25, 2012 $ uname -a Linux azrael 3.6.7-4.fc17.i686.PAE #1 SMP Tue Nov 20 20:07:38 UTC 2012 i686 i686 i386 GNU/Linux $ gnome-session --version gnome-session 3.4.2 $ printf "%s\n" $DESKTOP_SESSION gnome Link to comment Share on other sites More sharing options...
Haggis Veteran Posted November 25, 2012 Author Veteran Share Posted November 25, 2012 can u guys also do cat /etc/*-release[/CODE] Link to comment Share on other sites More sharing options...
+Majesticmerc MVC Posted November 25, 2012 MVC Share Posted November 25, 2012 Arch Linux releaseLSB_VERSION=1.4DISTRIB_ID=archDISTRIB_RELEASE=rollingDISTRIB_DESCRIPTION="Arch Linux"NAME="Arch Linux"ID=archPRETTY_NAME="Arch Linux"ANSI_COLOR="0;36"HOME_URL="https://www.archlinux.org/"SUPPORT_URL="https://bbs.archlinux.org/"BUG_REPORT_URL="https://bugs.archlinux.org/"[/CODE] Link to comment Share on other sites More sharing options...
Haggis Veteran Posted November 25, 2012 Author Veteran Share Posted November 25, 2012 lol why does arch need to be different from everyone else Link to comment Share on other sites More sharing options...
n_K Posted November 25, 2012 Share Posted November 25, 2012 NAME="Arch Linux" ID=arch PRETTY_NAME="Arch Linux" ANSI_COLOR="0;36" HOME_URL="https://www.archlinux.org/" SUPPORT_URL="https://bbs.archlinux.org/" BUG_REPORT_URL="https://bugs.archlinux.org/" :p Link to comment Share on other sites More sharing options...
tiagosilva29 Posted November 25, 2012 Share Posted November 25, 2012 $ cat /etc/*-release Fedora release 17 (Beefy Miracle) NAME=Fedora VERSION="17 (Beefy Miracle)" ID=fedora VERSION_ID=17 PRETTY_NAME="Fedora 17 (Beefy Miracle)" ANSI_COLOR="0;34" CPE_NAME="cpe:/o:fedoraproject:fedora:17" Fedora release 17 (Beefy Miracle) Fedora release 17 (Beefy Miracle) Link to comment Share on other sites More sharing options...
Haggis Veteran Posted November 25, 2012 Author Veteran Share Posted November 25, 2012 suppose could search for name first then do the normal for other distros Link to comment Share on other sites More sharing options...
+Majesticmerc MVC Posted November 25, 2012 MVC Share Posted November 25, 2012 what are you trying to do? Link to comment Share on other sites More sharing options...
Haggis Veteran Posted November 25, 2012 Author Veteran Share Posted November 25, 2012 i am making a little system script thats give system info and takes a screenshot on every other release so far the last line in "cat /etc/*-release" is the distro name all but Arch lol Link to comment Share on other sites More sharing options...
n_K Posted November 25, 2012 Share Posted November 25, 2012 I wouldn't rely on the last line being the OS name, I'd read it like an INI and get it from NAME="". There's no reason why the last line will be the OS name :) Link to comment Share on other sites More sharing options...
Haggis Veteran Posted November 25, 2012 Author Veteran Share Posted November 25, 2012 ok whats best way to pull that? Link to comment Share on other sites More sharing options...
n_K Posted November 25, 2012 Share Posted November 25, 2012 In bash? No idea :p Link to comment Share on other sites More sharing options...
+Majesticmerc MVC Posted November 25, 2012 MVC Share Posted November 25, 2012 ok whats best way to pull that? cat /etc/*-release | grep "^NAME=" | sed -r 's/NAME="?([^"]+)"?/\1/' Link to comment Share on other sites More sharing options...
Haggis Veteran Posted November 25, 2012 Author Veteran Share Posted November 25, 2012 Awesome thanks i had got as far as os=$(cat /etc/*-release | awk '/PRETTY_NAME/{print}')[/CODE] lol anyone wanna test it to make sure it works if i send a link? Link to comment Share on other sites More sharing options...
tiagosilva29 Posted November 25, 2012 Share Posted November 25, 2012 If you are only after the Linux distibution name (not the OS name) the installation is Linux Standard Base compliant (good luck with that): I think that lsb_release -i is what you need. If you're after the OS name on a POSIX compliant system, uname -s. Link to comment Share on other sites More sharing options...
+Majesticmerc MVC Posted November 25, 2012 MVC Share Posted November 25, 2012 Awesome thanks i had got as far as os=$(cat /etc/*-release | awk '/PRETTY_NAME/{print}')[/CODE] lol anyone wanna test it to make sure it works if i send a link? EDIT: Tiagosilva mentioned lsb_release, which seems to do a lot of what you need with less need for grepping and whatnot. [code] [karl@HERA ~]$ lsb_release -d Description: Arch Linux I assume that using 'lsb_release --codename' in Fedora would produce "Beefy Miracle", in Arch it produces "n/a". Link to comment Share on other sites More sharing options...
Haggis Veteran Posted November 25, 2012 Author Veteran Share Posted November 25, 2012 I used Pretty Name lol Link to comment Share on other sites More sharing options...
Karl L. Posted November 26, 2012 Share Posted November 26, 2012 In case you're still interested, I haven't seen any Debian users post yet so I'll contribute as well. $ echo $DESKTOP_SESSION$ cat /etc/os-releasePRETTY_NAME="Debian GNU/Linux wheezy/sid"NAME="Debian GNU/Linux"ID=debianANSI_COLOR="1;31"$ lsb_release -aDistributor ID: DebianDescription: Debian GNU/Linux testing (wheezy)Release: testingCodename: wheezy$ uname -aLinux ZIPPYZEBRA 3.2.0-4-powerpc #1 Debian 3.2.32-1 ppc GNU/Linux[/CODE] Note that my [i]$DESKTOP_SESSION[/i] is unset. I am running Openbox as my DE, if that helps. Link to comment Share on other sites More sharing options...
Haggis Veteran Posted November 26, 2012 Author Veteran Share Posted November 26, 2012 hmmm i thought openbopx set the $desktop_session thats fine though if it does not find any it sets as "Not Found" lol I think i will stick with Pretty_Name from /etc/*-release as it seems to be on all Distros xorangekiller i have pm'd you with a link if you would like to test i would like a few people with different distros to do this :) Link to comment Share on other sites More sharing options...
Recommended Posts