0

Suppose I'm on a Linux machine, in a shell session, and I want to obtain the list of options I would have if I logged in graphically and had to choose a desktop environment / session type. I expect a list with items such as "kde", "gnome", "xfce4", "cinnamon" etc.

Notes:

  • I would hope for a distribution-agnostic solution, but if you must know the distro - assume it's RHEL or Centos-based.
  • I'm not picky about the exact naming scheme, the names can be longer/shorter form, one-per-line or otherwise, that really doesn't matter.

1 Answer 1

3

The answer is surprisingly simple:

ls /usr/share/{wayland-,x}sessions 

will give you the list of session files that your login managers are aware of.

If you want to get the "human" names from all these:

sed -n 's/ *Name=\(.*\)$/\1/p' /usr/share/{wayland-,x}sessions/*.desktop 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.