Skip to content
  • PC & Mobile
    • Windows
    • Mac
    • Linux
    • Mobile
    • Android
    • iOS
    • Chrome OS
  • Hardware
    • Hardware & Gadgets
    • Product Review
    • Smart Home
  • Lifestyle
    • Internet
    • Gaming
    • Productivity
    • How Things Work
    • Glossary
  • Cheatsheets
  • About
    • About Us
    • Contact Us
    • Privacy
    • Advertise with Us
    • Write For Us

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.

Joshua Price

Josh Price is a senior MakeTechEasier writer and owner of Rain Dog Software

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Popular Posts

7 Ways to Speed up Ubuntu

How to Fix Broken Packages in Linux

3 Quick and Easy Ways to Open Any File as Root in Ubuntu

Ubuntu Software Center Not Working? Here Are the Fixes

How to Fix High CPU Usage in Linux

5 Ways to Hide Desktop Icons in Ubuntu

How to Change the Screen Resolution in Ubuntu

How to Hide the Top Bar and Side Panel in Ubuntu

How to Fix the "No Installation Candidate" Problem in Ubuntu

How to Set Up Bluetooth in Linux

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

© 2023 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.