Check the desktop environment in Linux, and view the desktop environment in linux
Linux desktop systems include gnome, kde, mate, cinnamon, lxde, xfce, and jwm. Common examples are gnome, kde, and xfce. So how can we determine which desktop environment components are installed in Linux? The following describes how to check the desktop environment:
Method 1: env | grep reply top_session = or echo $ reply top_session
This command can only be executed in the startup command window of the desktop system after entering the desktop system. You can use the SecureCRT tool to connect to the system. If you run this command, no results will be obtained.
Method 2: echo $ GDMSESSION
This command can only be executed in the startup command window of the desktop system after entering the desktop system. You can use the SecureCRT tool to connect to the system. If you run this command, no results will be obtained.
I tested two desktop environments (KDE and GNOME), but I don't know whether it is OK in other desktop environments. The two commands cannot be displayed in some desktop environments.
Method 3: run the ps command to check whether the desktop environment is installed.
3.1: No desktop components are installed
[root@testlnx01 ~]# runlevel
N 3
[root@testlnx01 ~]# ps -A | egrep -i "gnome|kde|mate|cinnamon|lx|xfce|jwm"
3.2: gnome Desktop components installed
[root@localhost ~]# ps -A | egrep -i "gnome|kde|mate|cinnamon|lx|xfce|jwm"
2304 ? 00:00:00 gnome-keyring-d
2314 ? 00:00:00 gnome-session
2352 ? 00:00:00 gnome-settings-
2377 ? 00:00:00 gnome-panel
2408 ? 00:00:00 gnome-power-man
2420 ? 00:00:00 polkit-gnome-au
2430 ? 00:00:00 gnome-volume-co
2448 ? 00:00:00 gnome-screensav
2497 ? 00:00:01 gnome-terminal
2500 ? 00:00:00 gnome-pty-helpe
Pgrep-l "gnome | kde | mate | cinnamon | lxde | xfce | jwm"
Ps-A | egrep-I "gnome | kde | mate | cinnamon | lxde | xfce | jwm"
Use the ps command or pgrep command
[root@localhost ~]# ps -A | egrep -i "gnome|kde|mate|cinnamon|lx|xfce|jwm"
2304 ? 00:00:00 gnome-keyring-d
2314 ? 00:00:00 gnome-session
2352 ? 00:00:00 gnome-settings-
2377 ? 00:00:00 gnome-panel
2408 ? 00:00:00 gnome-power-man
2420 ? 00:00:00 polkit-gnome-au
2430 ? 00:00:00 gnome-volume-co
2448 ? 00:00:00 gnome-screensav
2497 ? 00:00:01 gnome-terminal
2500 ? 00:00:00 gnome-pty-helpe
[root@localhost ~]# pgrep -l "gnome|kde|mate|cinnamon|lx|xfce|jwm"
2304 gnome-keyring-d
2314 gnome-session
2352 gnome-settings-
2377 gnome-panel
2408 gnome-power-man
2420 polkit-gnome-au
2430 gnome-volume-co
2448 gnome-screensav
If I unregister a user from the desktop environment and exit, as shown below, you will see that the process displayed by the same command is obviously less
[root@localhost ~]# pgrep -l "gnome|kde|mate|cinnamon|lx|xfce|jwm"
2882 gnome-session
2890 gnome-settings-
2909 polkit-gnome-au
2911 gnome-power-man
[root@localhost ~]# ps -A | egrep -i "gnome|kde|mate|cinnamon|lx|xfce|jwm"
2882 ? 00:00:00 gnome-session
2890 ? 00:00:00 gnome-settings-
2909 ? 00:00:00 polkit-gnome-au
2911 ? 00:00:00 gnome-power-man
[root@localhost ~]#
Method 4: yum grouplist | more check
References:
Http://superuser.com/questions/96151/how-do-i-check-whether-i-am-using-kde-or-gnome