Results 1 to 7 of 7

Thread: desktop environment information from command line

  1. #1
    Join Date
    Jul 2011
    Location
    /Europe/Netherlands
    Beans
    378
    Distro
    Kubuntu 22.04 Jammy Jellyfish

    desktop environment information from command line

    Is there any reliable way to tell which DE someone is using from the command line? I have seen terminal app that give an overview of your system and I wonder how they get information about WM and DE. I would like to know this for writing my own system summary script.

  2. #2
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: desktop environment information from command line

    echo $DESKTOP_SESSION ?

  3. #3
    Join Date
    Jul 2011
    Location
    /Europe/Netherlands
    Beans
    378
    Distro
    Kubuntu 22.04 Jammy Jellyfish

    Re: desktop environment information from command line

    Thanks. For KDE it gives me kde-plasma so that seems alright Does it work for XFCE (assuming you are using that) and other DEs like Gnome, LXDE, Cinnamon ?

  4. #4
    Join Date
    May 2007
    Location
    The New Forest
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: desktop environment information from command line

    it does here - tells me Xubuntu

  5. #5
    Join Date
    Apr 2008
    Location
    LOCATION=/dev/random
    Beans
    5,767
    Distro
    Ubuntu Development Release

    Re: desktop environment information from command line

    Output using Cinnamon....
    Code:
    rob@arch:~$ echo $DESKTOP_SESSION
    
    rob@arch:~$
    Cheesemill

  6. #6
    Join Date
    Jul 2011
    Location
    /Europe/Netherlands
    Beans
    378
    Distro
    Kubuntu 22.04 Jammy Jellyfish

    Re: desktop environment information from command line

    So it's not very reliable unfortunately. Are there any other ways to determine the DE? I could check for the existence of config folders (.kde .xfce ...) in ~ but that says nothing about the current session as one can have many DEs installed at once.

  7. #7
    Join Date
    Apr 2012
    Beans
    7,256

    Re: desktop environment information from command line

    if you're only interested in local sessions, I wonder if you could just look at what's running in tty7?

    Code:
    $ w $USER | awk '$2 ~ /tty7/ {print $7;}'
    gnome-session

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •