Let's assume we have a computer with Ubuntu Desktop installed on it. There are a few desktop environments (DE) installed such as: Unity, Gnome, KDE, XFCE, Mate, etc.
Also few users have their accounts and they regularly using the computer. Each user could change its DE according to its free will 🙂
How to determinate which is the current user's desktop environment, for certain user, through CLI within limited environment?
This question could be fragmented in this way:
In which file is stored this information?
What is the best way to read it through a script executed within an limited environment such as
How to read this information for random user?
I'm finding for one line command solution if it is possible.