Skip to content
  • PC & Mobile
    • Windows
    • Mac
    • Linux
    • Mobile
    • Android
    • iOS
    • Chrome OS
  • Hardware
    • PC Hardware
    • Product Review
    • Smart Home
  • Lifestyle
    • Internet
    • Gaming
    • Productivity
    • How Things Work
    • Glossary
    • News
  • Cheatsheets
  • Deals

Dark mode:

Home > Linux

How to Customize the GDM Sessions List

Joshua Price
Aug 8, 2010

Have you ever installed a new Linux window manager or desktop environment, only to find that it doesn’t show up on the Sessions list in GDM? Have you ever wanted to remove items from that list? How about create a new list item so that you can boot into a custom desktop environment? It sounds like it should be simple, but many people are surprised by the fact that this small task is actually a bit tricky, and there’s very little documentation to help. We hope to resolve that today with a quick and simple guide to editing your GDM Sessions menu.

/usr/share/xsessions

The list is populated by looking at the contents of the /usr/share/xsessions directory. In here you’ll find files with the .desktop extension (extension hidden in some file managers). As these files are in a system folder, you will need root privileges to change or delete them.

sessions-files

These .desktop files contain basic information on what this menu item will launch. Removing (or renaming) one of these files will take it off the Sessions list.

Modifying an Item

As noted above, you’ll need root privileges to modify any of the files in /usr/share/xsessions. Ubuntu users, for exaple, can hit Alt+F2 to open the command box and enter

gksu gedit

to run the gedit text editor as root. Open any .desktop file in the /usr/share/xsessions directory that you wish to edit.

sessions-openbox

Creating a New Entry

Using the above screenshot as a template, you can design your own entry for the menu.

The Encoding line is referring to the character encoding used in the file, and can safely be left at UTF-8 for nearly all purposes.

The Name is what will be displayed on GDM’s Sessions list, followed by a brief description in the Comment line.

The Exec line is probably the most important in the list. This is the section where you specify the command to run when the menu item is clicked. It will accept command line arguments as well (ie gnome-session -f). This line can also be set to a custom script that you have made.

Next is the Icon line, which in some circumstances can be used to specify the icon for an application, but it is not mandatory for the launchers in the session list.

Since .desktop files have uses beyond just GDM, they include a Type field to specify what the file represents. It can be left at Application for these purposes.

sessions-custom

A complete list of the properties and their meanings can be found here.

Once your files is saved, you’ll now see it listed on the Sessions list when GDM starts up. You also have the option of setting it as the default desktop session. To do from within Gnome, click System -> Administration -> Login Screen. In the dropdown box, select your new custom entry.

sessions-setdefault

Conclusion

With knowledge of how to control the GDM session options, you’re now in a place where you can create your own custom desktop environment by piecing together the individual components you like. As it so happens, that is the subject of an upcoming article – “How to Create Your Own Custom Desktop Environment”. Check back in a few days or follow us on RSS, Facebook or Twitter for that and more MTE goodness.

Is this article useful?
Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

  • Facebook
  • Tweet

Popular Posts

The Beginner's Guide to Git

How to Fix Can't Type in Terminal Issue in Linux

How to Set Up an SFTP Server on Linux

How to Utilize Python for Basic Linux System Administration and Networking Tasks

How to Use the G++ Compiler on Linux

How to Use tcpdump for Packet Capture

9 of the Best Email Clients for Linux

How to Generate SSL Certificates on Linux Using OpenSSL

How to Use the Nessus Vulnerability Scanner on Linux

How to Use Emacs for RSS with Elfeed

Affiliate Disclosure: Make Tech Easier may earn commission on products purchased through our links, which supports the work we do for our readers.

Read Next

The Beginner’s Guide to Git
How to Use Sed in Linux for Basic Shell Tasks
5 Tools to Easily Create a Custom Linux Distro
What Is the Matrix Protocol and How to Install It
Why and How to Edit Your Sudoers File in Linux
5 Tricks to Speed Up Compile Times in Gentoo Linux
7 of the Best LaTeX Editors for Linux
What Is Artix Linux and How to Install It

© 2022 Uqnic Network Pte Ltd.
All rights reserved.

  • About
  • Contact
  • Advertise
  • Write For Us
  • Terms of Use
  • Privacy Policy
  • RSS Feed Terms
Do not share my Personal Information.