The most efficient way to run GUI applications is to run a display server and a window manager.
Despite efforts like Wayland and Mir, X.Org is still the de facto display server. It is enabled by default almost everywhere so you don’t need to do anything about it.
You just need to choose a window manager. Compiz comes by default with Ubuntu so it’s a good choice if you don’t want to install new stuff yet. Openbox is also a sane choice. Xmonad is my favorite, so I’m going to use it as the example here.1
First you need to add a login session by creating the file
/usr/share/xsessions/custom.desktop with this content:
[Desktop Entry] Name=Xsession Exec=/etc/X11/Xsession
Make sure the file is readable by everyone or the login manager won’t be able to load it.
chmod +r /usr/share/xsessions/custom.desktop
When a user logs in using this custom session,
/etc/X11/Xsession will be
executed. It will (among other things) checks for a file name
the user’s home directory and execute the file if it’s there. We are going to
create that file now:
#!/usr/bin/env bash compton & dropbox & exec xmonad
Compton is a “compositor”. Basically it provides window transparency which I like. You won’t need it in a heavy window manager like Compiz. You do need it for Openbox though.
Dropbox is another program that I want to start together with my login session. Of course, you don’t have to add it, and you should add anything else that you want to start automatically here.
Once you’re done, log out and you should see your entry “Xsession” in the list of sessions in the login screen. Just use that from now on :)
This post was adapted from an archive.org snapshot of my old blog which was free and is now dead (yeah, free hosting). ↩