2

I need switch script in between lubuntu, ubuntu, and kubuntu. How can I know which platform the script is running in?

Because uname/lsb_release never show different in those 3 releases

Lubuntu$ uname -a
Linux 3.16.0-33-generic #44-Ubuntu SMP Thu Mar 12 12:19:35 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux

Lubuntu$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 14.10
Release:    14.10
Codename:   utopic

Lubuntu$ cat /etc/*release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=14.10
DISTRIB_CODENAME=utopic
DISTRIB_DESCRIPTION="Ubuntu 14.10"
NAME="Ubuntu"
VERSION="14.10 (Utopic Unicorn)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 14.10"
VERSION_ID="14.10"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
5
  • lsb_release -a Mar 30, 2015 at 5:10
  • 1
    lsb_release -a never show different in lu/u/kubuntu system Mar 30, 2015 at 5:25
  • how about uname -a Mar 30, 2015 at 5:28
  • Are you open to using fact gathering systems like 'facter' or 'ohai'? They should be able to get the actual release.
    – spuder
    Mar 30, 2015 at 6:10
  • ohai & facter they both show ubuntu only Mar 30, 2015 at 7:03

1 Answer 1

3

env | grep XDG_CURRENT_DESKTOP returns the desktop environment currently in use. In my case, I see LXDE which is the desktop environment Lubuntu currently uses. echo $DESKTOP_SESSION returns Lubuntu.

1
  • This won't work if you have a server (without X installed). :/
    – zrajm
    Sep 10, 2021 at 7:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .