35

I'm a Linux and KDE user, and recently I started to use also Enlightenment as a substitute Desktop environment when I need a lighter resource consumption.

I use KDM as a display manager, and I need to find a way to correctly set the default desktop environment to my preferences.

I wish to be able to set KDE as the default choice because I use it on a daily basis, and manually pick a different one just when I need it.

Currently it is set to boot the last used DE, and I can't find how to change this behaviour. The KDM control module in KDE System Settings does not seem to offer me this option.

Any clues on how can I do it?

Sekhemty
  • 9,916

5 Answers5

28

You should be able to set this up by editing your $HOME/.dmrc file. The sessions available to your display manager (whichever one you use) are .desktop files normally located in /usr/share/xsessions. In my case, this directory contains:

$ ls /usr/share/xsessions
cinnamon2d.desktop  gnome-fallback.desktop  openbox-gnome.desktop  xfce.desktop
cinnamon.desktop    mate.desktop            openbox-kde.desktop
gnome.desktop       openbox.desktop         ssh.desktop

Any of those files is a possible session that my display manager can choose. Which one is controlled by the $HOME/.dmrc file. So, to make KDE the default, you would have to edit that file and make it look like this:

[Desktop]
Session=kde-plasma

That assumes that you have a kde.desktop file in the xsessions directory, I don't use KDE so I can't check but it works for me using cinnamon or xfce. Once you have made that change, you should be logged in to KDE by default every time.

terdon
  • 54,564
16

In GNOME 2, the .dmrc file in the user home directory was used to create default sessions. This .dmrc file is no longer used.

To specify a default session for a user, update the user’s account service in the /var/lib/AccountsService/users/*username* file:

[User]
Language=
XSession=mate

Source

4

Works for Centos 7/RHEL If $HOME/.dmrc doesn't exist:

  1. From dir /usr/share/xsessions move all *.desktop files to another directory (unnecessary_env, for example) and leave only the one you need (in my case - xfce.desktop):

    $ ls /usr/share/xsessions xfce.desktop unnecessary_env/

  2. After logout/reboot XFCE will be loaded by default

Note! You won't be able to choose between GUI

AJM
  • 500
c ccx
  • 51
4

For RHEL/CentOS 7 you can set the file /etc/sysconfig/desktop to contain DESKTOP=KDE which will default it to KDE.

This also works for VNC.

Everlight
  • 183
  • 1
  • 9
1

I tried many options. The worker turned out to be the following:

MATE

echo "exec /usr/bin/mate-session" >> ~/.xinitrc

Cinnamon

echo "exec /usr/bin/cinnamon-session" >> ~/.xinitrc

KDE

echo "exec startkde" >> ~/.xinitrc

Source

AJM
  • 500
VictorS
  • 11