http://superuser.com/questions/96151/how-do-i-check-whether-i-am-using-kde-or-gnome
1) pgrep -l "gnome|kde|mate|cinnamon|lxde|xfce|jwm"
2556 gnome-session
2580 gnome-settings-
2594 gnome-power-man
2598 polkit-gnome-au
2) ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"
2556 ? 00:00:00 gnome-session
2580 ? 00:00:06 gnome-settings-
2594 ? 00:00:03 gnome-power-man
2598 ? 00:00:00 polkit-gnome-au
3) ls /usr/bin/*session*
- in GNOME returns /usr/bin/gnome-session (and more)
- in MATE returns /usr/bin/mate-session (and more)
- in LXDE returns /usr/bin/lxsession (and more)
4)
ps -ef | grep gnome 最简单