I have a few configuration scripts that I run everytime I install a fresh version of Ubuntu. Recently, however, I migrated to Xubuntu. I would like to use the same script for both distros, since both of them are very similar, but I would also like some parts of the script to be executed only under Xubuntu, and others only under Ubuntu.
My question is: is there a way to tell these distros apart via shell script?
I tried using the lsb-release
application, but it seems to not be implemented under Xubuntu; I also tried to read the contents of /etc/*-release
, but the contents seem to be similar in both distros.
$ lsb_release
No LSB modules are available.
$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=15.04
DISTRIB_CODENAME=vivid
DISTRIB_DESCRIPTION="Ubuntu 15.04"
lsb_relase -a
in Xubuntu and it displayed the contents of/etc/*-release
, saying that Xubuntu is Ubuntu. – Douglas De Rizzo Meneghetti May 25 at 19:16echo $XDG_CURRENT_DESKTOP
– Costas May 25 at 22:57