How to Easily Create a Custom Lightweight Desktop Environment

Gnome and KDE are great – they give you a beautiful desktop with all the tools and utilities you need. On either system, you’ll find a solid window manager, desktop icons, a panel full of applets, the works. That’s all well and good for your average desktop PC, but what if you need something lighter, faster, or cleaner in appearance? You could try a smaller desktop environment like XFCE or go with something ultra-slim like Openbox or WindowMaker. On the other hand, you could get exactly what you want, no more no less, by combining individual pieces together into your own custom desktop environment.

How?

When you run Gnome, you’re not running a single application. Gnome launches Metacity (optionally Compiz) to handle window management, gnome-panel to serve as the panel and menu system, and various applets and tools for things like power management and Bluetooth support. Each of these is independent of the others and can be replaced or launched on its own.

What we’ll be doing today is specifying our own list of applications (window manager, dock, etc) to run on login, completely bypassing the likes of Gnome and KDE in favor of our custom apps. There are a few methods of achieving this, and the one demonstrated here was chosen to be functional, simple, and not very distribution-specific.

Designing Your Desktop

To create a functional DE, you’ll need a few basic parts:

Window manager (Metacity, Compiz, etc)

Application launcher (Gnome-Do, Kupfer, etc)

Panel/Dock (Docky, Cairo Dock, PyPanel, etc)

Wallpaper manager (bsetroot, hsetroot, etc)

Optional panel applets, desktop widgets, etc

This guide will use Compiz, Gnome-Do, Cairo Dock (with applets), and hsetroot to achieve all the needed functionality. Using Compiz as the base window manager gives us the full set of Compiz plugins like Expo and Zoom. All those packages should be available in the standard repositories of most distributions. Ubuntu users can fetch them from the Ubuntu Software Center or with the terminal command:

Most of these applications have been discussed in detail on MakeTechEasier. Use our search box to gather more information on which tool is the best for your needs.

Some other usable setups could include dropping the dock/panel entirely and using Gnome-Do for all app launching needs, or adding something like Conky or Google Desktop for system monitoring.

Creating the List

Now that you’ve got an application chosen for each of the roles above, we can begin creating a list so that they will be run on login. Begin by opening any text editor of your choice, and writing out the names of the programs to be run. End each of the lines (except the last) with a &. This symbol tells Linux to run the program in the background and move on to the next item. Without the &, it would run the first line and wait until that program was completed before running the next. That could, for example, prevent the dock from loading until after the window manager is closed – clearly not what we want.

When finished, save the file to any directory you choose (your home is fine) and take note of the file’s name and location. As my name is Josh, I have the file saved in /home/josh/customDE.sh.

Adding to GDM list

In what I’m sure must be amazing coincidence, we recently wrote a detailed guide on precisely how to edit the GDM Sessions list to let you launch your own desktop environment.

In short, you’ll want to (as root) create a new file in the /usr/share/xsessions directory. The file should end with the .desktop extension, and follow a template similar to the following:

The only really important lines for this scenario are Name and Exec. Name must uniquely identify your DE so that you can recognize it in the GDM Sessions list. Exec must be the name of the file we created in the previous step, such as customDE.sh.

Save the file as /usr/share/xsessions/custom.desktop. Next time you logout, you’ll see your entry in the Sessions list in GDM.

Conclusion

If you’ve followed each of these steps, you created a list of applications you wanted in your DE, saved that list (with appropriate ampersands) into a script, then created a launcher in /usr/share/xsessions to start that script from GDM. Hopefully, your choices have left you with a feature-complete and beautiful desktop. Not only should it meet your specific needs, but there’s a good chance it’ll be far more responsive than a monolithic desktop system like Gnome.

If you’ve got desktop customization stories or suggestions for how to create your own, let us know in the comments!

Is this article useful?

The Complete Beginner's Guide to Ubuntu 16.04

Are you tired of using Windows or OS X as your operating system and thinking of trying out, and possibly switching, to Linux? In this Complete Beginner's Guide to Ubuntu 16.04 ebook, we will guide you and show you everything you need to know about Ubuntu - the most popular Linux distro.

I had considered using Openbox as the example window manager, but I wanted to emphasize that you don't have to sacrifice the flashy effects, if you want them, in order to make your own desktop.

Yours looks excellent! I had done something similar with conky & openbox because ob would let me specify a desktop margin where windows would not overlap, and I could leave my conky info bar running in view.

I had never looked at SLiM until now, that looks like a great article topic. Thanks for the reply!

The only thing you're missing here that most people would probably consider part of a reasonably complete desktop environment are desktop icons. Good options for providing that are pcmanfm, idesk, and rox-filer.

I have a couple of questions. I’m trying to achieve a single effect: A small fixed number of windows always maximized and always running the same software (which may in turn be tabbed). Specifically, one of the following sets of software would be running at startup and no other software: A browser, emacs; A browser, emacs, file manager; or a browser, emacs, a filemanager and a terminal. The only thing that is needed is the ability to switch between windows (and thus apps) with a hotkey. There is no need for a panel, but a launcher available from a hot key might be nice in case one of the apps crashes. Oh, and I suppose there has to be a way of picking a wireless connection (that could be managed in the terminal)

So, my questions are: Can this be done with no panel or desktop icon capacity? If so, does that recommend a specific window manager? Are there window managers that don’t do windows at all, i.e., make everything full screen, or can one be recompiled to make this happen?

If one eliminates the need for managing windows other than spawning a fixed arbitrary number of them, does that also eliminate the need for additional libraries?

It sounds like you want certain apps to auto-launch on specific desktops, auto-maximized. My long-time favorite window manager Window Maker can do all of the above, but I’m not sure it will be quite as graphically minimalist as you seem to want. My first ever MTE post was on how to configure Window Maker in a way that I personally find to be far more productive than any other WM out there. http://maketecheasier.com/create-a-great-window-maker-desktop/2009/02/14/

For a *almost* completely minimalist desktop that can do most (possibly all, I’m not sure) of the above, OpenBox might be what you’re looking for. I’m not certain if it can auto-maximize windows but I’m fairly sure you can start specific apps on launch and it’s extremely clean, graphically.

For a COMPLETELY spartan desktop, you can use Compiz as described in this article along with the Expo plugin to handle workspace management (I describe my personal favorite compiz setup here http://maketecheasier.com/extreme-desktop-makeover-josh-edition/2010/04/22/

As you may be able to tell from those links, I have a very specific set of needs for my WM/DE. Currently I am running a desktop (compiz + expo) similar to that second link, but I have replaced nearly everything in the “info bar” on the right with a custom homegrown dock. When it’s ready, it’ll be released open source.

Window Maker has its own widget set outside the normal GTK/QT stuff. It’s extremely light and fast, but many people find the aesthetics to be a bit lacking. If you can get past that, I think it would do everything you requested exceedingly well.

This is in no way light…Compiz is in of its self is heavy, if you were wanting something with all the functionality of Compiz, you could use a box WM and then use a couple extra applications (3ddesktop, skippy-xd, and xdesktopwaves) with a composite manager (cairo composite manager, xcompmgr) and then you would have a truly flashy and light weight window manager. For docks, i would never use docky, again that’s very heavy, you should look at Wbar, Simdock, or Adeskbar for your docking needs. For Terminal and application launchers, gnome do is resource heavy and has Gnome dependencies, GMRun is a better alternative to gnome-Do, and the Basic xterm has what you need for terminal work. For wallpaper, you could use FEH, Nitrogen, or even PCmanFM if you wanted to.

You should mention that the compiz is 2 things at the same time: a window manager and a composite manager.

Personnaly I use openbox with cairo-compmgr as a window manager & composite manager, it’s a lot lighter and slimmer than compiz. feh for the background.

Openbox use ~/.config/openbox/autorun.sh to start things when you open your session. I put my stuff there and I use slim as a desktop manager, it is very minimal and light.

You don’t mention automounting of devices. That should be part of the desktop and is impacted by the distro (whether it’s with use hal, udev or else). I haven’t installed gnome at all. But for automounting I use uam (project part of xfce desktop, see https://github.com/mgorny/uam/ ).