Adding graphical environment options at login

It is possible to add or remove a new window manager, desktop environment, or standalone application from your available options at login.

Command Line Login
Presumably, if you are using the CLI for logging in, then you are a confident Linux user. Look to ~/.xinitrc for editing available login options. This enables different choices by varying the name passed with 'startx'.

Graphical Login
Many users will rely on a graphical user login screen, where the choices of user and environment are attractively presented to choose with the mouse. The main contenders are kdm, gdm and xdm. Find out which is relevant to you (can someone help here?) and look below...

kdm
To add an application to a kdm login, you will need to create two files:

/usr/share/apps/kdm/session/0#NAME.desktop Duplicate one of the existing .desktop files and edit it. Give it the name, where # is a number between 1 and 9 that hasn't already been used, and NAME is a brief name (no spaces) to identify the option.

Here is the KDE .desktop entry:

[Desktop Entry] Encoding=UTF-8 Name=KDE Comment=KDE TryExec=/usr/bin/startkde Exec=KDE Icon= Type=Application

Change the details as relevant for your WM or application.

/etc/X11/wmsession.d/ Again duplicate one of the files, and give it the same name as before (minus the .desktop suffix).

Here is the ../wmsession.d/01KDE file for reference:

NAME=KDE ICON=kde-wmsession.xpm DESC=The K Desktop Environment EXEC=/usr/bin/startkde SCRIPT: exec /usr/bin/startkde

Now when you reach your login screen, you should get your new application in the drop-down selection box.

xdm
Superseded in many cases by kdm (?)