I have a creepy problem here. I have to identify the desktop environment installed by an user without to know with one it's used by a user to change the user session value in some lightdm-files.
The user can select between
- Unity
- Gnome3
- Mate
- Xfce
- Pantheon
- Kde
- Lxde
- Cinnamon
- Enlightenment
I have to change the user-session value in more than one file here is an example
[SeatDefaults]
greeter-session=lightdm-webkit-greeter
user-session=value-to-cahgne
To determine the package I have the following code
usersession() {
if dpkg-query -l package to check for > /dev/null; then
setunty
elif dpkg-query -l package to check for > /dev/null; then
setgnome
elif dpkg-query -l package to check for > /dev/null; then
setmate
elif dpkg-query -l package to check for > /dev/null; then
setxfce
elif ! dpkg-query -l package to check for > /dev/null; then
setpantheon
elif dpkg-query -l package to check for > /dev/null; then
setkde
elif dpkg-query -l package to check for > /dev/null; then
setlxde
elif dpkg-query -l package to check for > /dev/null; then
setcinnamon
elif dpkg-query -l package to check for > /dev/null; then
setenlightenment
fi
}
The string "package" to check for in the above code is what needs to be replaced.
What strings should I use to check dpkg -l for the current desktop environment?
0 Answers