Change LightDM Default Session

In the world of Linux, customizing your desktop environment can greatly enhance your user experience. One such customization involves changing the default session in LightDM, the display manager for Ubuntu and other Linux distributions. This guide will walk you through the process, ensuring you have the right tools and knowledge to make the switch.

a woman standing in front of a light with her arms up to the side and hands behind her head
a woman standing in front of a light with her arms up to the side and hands behind her head

Before we dive in, it's crucial to understand that LightDM manages the graphical login screen, allowing multiple desktop environments to coexist. By default, it uses the 'ubuntu' session, but you can change this to suit your preferences. Let's explore how to do this.

фото через искусственный интеллект. промпт не уместился в описание пиши комментарий скину промпт
фото через искусственный интеллект. промпт не уместился в описание пиши комментарий скину промпт

Understanding LightDM Sessions

LightDM sessions are defined in the /usr/share/xsessions directory. Each session is represented by a .desktop file, containing information about the desktop environment, such as its name, command, and icon. Understanding these files is key to changing your default session.

a man standing in front of some lights with his back turned to the camera,
a man standing in front of some lights with his back turned to the camera,

Some popular sessions include 'gnome', 'kde', and 'xfce', each representing a different desktop environment. You can list all available sessions using the command 'ls /usr/share/xsessions'.

Identifying Your Current Session

merlin.lightpainting
merlin.lightpainting

To find out which session is currently set as default, open a terminal and type:

cat /etc/lightdm/lightdm.conf | grep -i 'session-setup'

The output will display the path to the .desktop file of your current default session.

Changing the Default Session

a woman holding a light bulb in her right hand and looking at it with both hands
a woman holding a light bulb in her right hand and looking at it with both hands

Now that you know how to identify your current session, let's change it. First, decide on the session you want to use. For this example, let's switch to the 'gnome' session.

Open the LightDM configuration file with a text editor. For instance, use nano:

sudo nano /etc/lightdm/lightdm.conf

Find the line that says 'session-setup=example.desktop' and replace 'example' with 'gnome'. Save and close the file, then restart LightDM to apply the changes:

the light is shining brightly in the dark room with blue and yellow beams coming from it
the light is shining brightly in the dark room with blue and yellow beams coming from it

sudo systemctl restart lightdm

Upon restart, you should now see the GNOME login screen. If you want to revert to your previous session, simply repeat the process with the appropriate .desktop file.

Customizing Your Login Screen

the sun shines brightly through the trees in the forest, reflecting on the water
the sun shines brightly through the trees in the forest, reflecting on the water
Side Light Photography, Natural Lighting Photography, Dynamic Lighting, Side Lighting Photography, Photography Lighting, Natural Light Portrait Photography, Lighting Photography, Warmth Photography, Strong Lighting Portraits
Side Light Photography, Natural Lighting Photography, Dynamic Lighting, Side Lighting Photography, Photography Lighting, Natural Light Portrait Photography, Lighting Photography, Warmth Photography, Strong Lighting Portraits
a person standing in tall grass at night
a person standing in tall grass at night
a woman's profile in the dark with her hair pulled back and glowing green
a woman's profile in the dark with her hair pulled back and glowing green
تصاميم فنية راقية تجمع بين الفخامة والبساطة | Luxury Abstract Art Inspiration
تصاميم فنية راقية تجمع بين الفخامة والبساطة | Luxury Abstract Art Inspiration
Éclairage Circadien : Guide Complet pour Améliorer Bien-être et Productivité
Éclairage Circadien : Guide Complet pour Améliorer Bien-être et Productivité
a woman's face is shown with colorful lights in the background and her hands on her head
a woman's face is shown with colorful lights in the background and her hands on her head
the woman is posing with her hands on her face
the woman is posing with her hands on her face
a man sitting in a chair with his legs spread out
a man sitting in a chair with his legs spread out
Tegenlicht
Tegenlicht
the light is shining brightly in the dark night time scene as seen through a lens
the light is shining brightly in the dark night time scene as seen through a lens
a young man holding his hands to his face in the dark, with one hand on his head
a young man holding his hands to his face in the dark, with one hand on his head
a woman standing in front of a blue light with her arms up and hands behind her head
a woman standing in front of a blue light with her arms up and hands behind her head
How To Create Amazing Light-Painted Portraits Step-by-Step - Digital Photo Mentor
How To Create Amazing Light-Painted Portraits Step-by-Step - Digital Photo Mentor
Dark in light
Dark in light
a black and white photo of a woman in profile
a black and white photo of a woman in profile
Embrace Your Inner Glow ✨ Self Love Aesthetic Guide 🌸
Embrace Your Inner Glow ✨ Self Love Aesthetic Guide 🌸
a woman with long hair posing for the camera
a woman with long hair posing for the camera
a woman holding a lit candle in her hand at night with the moon behind her
a woman holding a lit candle in her hand at night with the moon behind her
a feeling
a feeling

Changing the default session is just one aspect of customizing your LightDM experience. You can also modify the login screen's appearance and behavior.

To do this, you'll need to edit the /etc/lightdm/lightdm.conf file again. Here, you can change the theme, background, and other visual aspects of your login screen. For instance, to change the background image, add or modify the following line:

background=path/to/your/image

Replace 'path/to/your/image' with the path to your desired image. You can also adjust other settings, such as the font, cursor, and user list behavior.

Using a Custom Theme

LightDM supports themes, allowing you to further customize your login screen. To use a custom theme, first, install it using your package manager. For example, to install the 'lightdm-ubuntu-greeter' theme, use:

sudo apt-get install lightdm-ubuntu-greeter

Then, in the lightdm.conf file, set the theme using the 'greeter-session' option:

greeter-session=lightdm-ubuntu-greeter

Restart LightDM to apply the changes:

sudo systemctl restart lightdm

You should now see your new theme in action.

And there you have it! You've successfully changed your LightDM default session and customized your login screen. This process allows you to tailor your Linux experience to your unique needs and preferences. Happy customizing!