Sometimes it may be needed that a user only has access to a certain application. Running the desktop environment then may be unwanted be it either for security reasons or for acchieving a better accessibility to the given application.
In these cases it may be desired to replace the desktop by an application that runs immediately after login.
Other users should have a normal access to their desktops.
Replacing Desktop By An Application
Define User Defined Session
First we will have to define a User Defined Session that handles the special case when no desktop should be loaded. We will define this session by creating a custom.desktop file in /usr/share/xsessions/ with a content similar to this:
This will tell GDM to run the script
.xsession
located in the HOME of the user<username>
.Optional
X-Ubuntu-Gettext-Domain
is needed for a correct language translation in case we load Unity/GNOME desktop later (replace withgdm
in 10.04).Make A Script To Start
This script ~/.xsession could look as simple as that:
Load Custom Session On Login
If we now define to load our session "Custom" during the given user's login at the gdm screen only the X-Terminal will be started and we will be back at gdm on exit. Next time we login as the user this setting will be remembered as default.
Run Application That Need Windows-Managing
Of course we are not yet able to run an application that needs a windows manager such as GNOME. To do this replace the .xsession script by something like:
We can see that the GNOME windows manager is now loaded but no desktop elements are present. This enables an application (e.g. firefox here) to start.
But take care what you do: If we minimize the application to the non-existent tray we will end up with a nice wallpaper to look at. Because of this it is very important to include
logout
at the end of the script to logout the session after the application terminated. There really is no other programm running to do this for you until you add one to your script. You deliberately replaced your desktop by firefox only (a bad idea).Of course we would also be able to start
gnome-desktop
orgnome-session
(resp. options) from the script but this is what we already do by default.