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/"
  • lsb_release -a – Milind Dumbare Mar 30 '15 at 5:10
  • lsb_release -a never show different in lu/u/kubuntu system – Liao Zhuodi Mar 30 '15 at 5:25
  • how about uname -a – Milind Dumbare Mar 30 '15 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 '15 at 6:10
  • ohai & facter they both show ubuntu only – Liao Zhuodi Mar 30 '15 at 7:03
2

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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.