Skip to main content
Making the whole answer look nicer to make it easier to read.
Source Link

I've tested the best tools I've found with a) GNOME under Linux Mint installed; b) GNOME under Linux Mint Live USB; c) MATE under Linux Mint; d) LXDE under Lubuntu; e) JWM under Puppy Linux (JWM is not a desktop environment but a stacking window manager). My results:

  1. GNOME under Linux Mint installed;
  2. GNOME under Linux Mint Live USB;
  3. MATE under Linux Mint;
  4. LXDE under Lubuntu;
  5. JWM under Puppy Linux (so-soJWM is not a desktop environment but a stacking window manager) env | grep DESKTOP_SESSION=.

a)&b) DESKTOP_SESSION=gnome ; c) DESKTOP_SESSION=default.desktop ; d) DESKTOP_SESSION=Lubuntu ; e) (nothing)

  1. (so-so) echo $GDMSESSION

a)&b) gnome ; c) (nothing) ; d) Lubuntu ; e) (nothing)

  1. (well, but not perfect) pgrep -l "gnome|kde|mate|cinnamon|lxde|xfce|jwm" or ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"

a)&b) (OK) ; c) (OK) ; d) (WRONG) ; e) (nothing) & (OK)

  1. (very well, but not perfect) HardInfo

a) (nothing) ; b) GNOME 2.32.0 ; c) MATE ; d) LXDE (Lubuntu) ; e) Unknown (Window ManagerMy results: JWM)

  1. (so-so)
    env | grep DESKTOP_SESSION=

    1. DESKTOP_SESSION=gnome
    2. DESKTOP_SESSION=gnome
    3. DESKTOP_SESSION=default.desktop
    4. DESKTOP_SESSION=Lubuntu
    5. (nothing)
  2. (so-so)
    echo $GDMSESSION

    1. gnome
    2. gnome
    3. (nothing)
    4. Lubuntu
    5. (nothing)
  3. (well, but not perfect)
    pgrep -l "gnome|kde|mate|cinnamon|lxde|xfce|jwm"
    ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"

    1. (OK)
    2. (OK)
    3. (OK)
    4. (WRONG)
    5. (nothing) & (OK)
  4. (very well, but not perfect)
    HardInfo

    1. (nothing);
    2. GNOME 2.32.0
    3. MATE
    4. LXDE (Lubuntu)
    5. Unknown (Window Manager: JWM)

CONCLUSION: A combination of HardInfo and the command ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"

ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"

probably will give the desired answer.

I've tested the best tools I've found with a) GNOME under Linux Mint installed; b) GNOME under Linux Mint Live USB; c) MATE under Linux Mint; d) LXDE under Lubuntu; e) JWM under Puppy Linux (JWM is not a desktop environment but a stacking window manager). My results:

  1. (so-so) env | grep DESKTOP_SESSION=

a)&b) DESKTOP_SESSION=gnome ; c) DESKTOP_SESSION=default.desktop ; d) DESKTOP_SESSION=Lubuntu ; e) (nothing)

  1. (so-so) echo $GDMSESSION

a)&b) gnome ; c) (nothing) ; d) Lubuntu ; e) (nothing)

  1. (well, but not perfect) pgrep -l "gnome|kde|mate|cinnamon|lxde|xfce|jwm" or ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"

a)&b) (OK) ; c) (OK) ; d) (WRONG) ; e) (nothing) & (OK)

  1. (very well, but not perfect) HardInfo

a) (nothing) ; b) GNOME 2.32.0 ; c) MATE ; d) LXDE (Lubuntu) ; e) Unknown (Window Manager: JWM)

CONCLUSION: A combination of HardInfo and the command ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm" probably will give the desired answer.

I've tested the best tools I've found with

  1. GNOME under Linux Mint installed;
  2. GNOME under Linux Mint Live USB;
  3. MATE under Linux Mint;
  4. LXDE under Lubuntu;
  5. JWM under Puppy Linux (JWM is not a desktop environment but a stacking window manager).

My results:

  1. (so-so)
    env | grep DESKTOP_SESSION=

    1. DESKTOP_SESSION=gnome
    2. DESKTOP_SESSION=gnome
    3. DESKTOP_SESSION=default.desktop
    4. DESKTOP_SESSION=Lubuntu
    5. (nothing)
  2. (so-so)
    echo $GDMSESSION

    1. gnome
    2. gnome
    3. (nothing)
    4. Lubuntu
    5. (nothing)
  3. (well, but not perfect)
    pgrep -l "gnome|kde|mate|cinnamon|lxde|xfce|jwm"
    ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"

    1. (OK)
    2. (OK)
    3. (OK)
    4. (WRONG)
    5. (nothing) & (OK)
  4. (very well, but not perfect)
    HardInfo

    1. (nothing);
    2. GNOME 2.32.0
    3. MATE
    4. LXDE (Lubuntu)
    5. Unknown (Window Manager: JWM)

CONCLUSION: A combination of HardInfo and the command

ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"

probably will give the desired answer.

Source Link
Madiue
  • 161
  • 1
  • 2

I've tested the best tools I've found with a) GNOME under Linux Mint installed; b) GNOME under Linux Mint Live USB; c) MATE under Linux Mint; d) LXDE under Lubuntu; e) JWM under Puppy Linux (JWM is not a desktop environment but a stacking window manager). My results:

  1. (so-so) env | grep DESKTOP_SESSION=

a)&b) DESKTOP_SESSION=gnome ; c) DESKTOP_SESSION=default.desktop ; d) DESKTOP_SESSION=Lubuntu ; e) (nothing)

  1. (so-so) echo $GDMSESSION

a)&b) gnome ; c) (nothing) ; d) Lubuntu ; e) (nothing)

  1. (well, but not perfect) pgrep -l "gnome|kde|mate|cinnamon|lxde|xfce|jwm" or ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm"

a)&b) (OK) ; c) (OK) ; d) (WRONG) ; e) (nothing) & (OK)

  1. (very well, but not perfect) HardInfo

a) (nothing) ; b) GNOME 2.32.0 ; c) MATE ; d) LXDE (Lubuntu) ; e) Unknown (Window Manager: JWM)

CONCLUSION: A combination of HardInfo and the command ps -A | egrep -i "gnome|kde|mate|cinnamon|lxde|xfce|jwm" probably will give the desired answer.