In the Linux world, a display manager is a little GUI program that presents the user with a login screen right after boot, allows her to enter her login credentials and choose the desired desktop environment or window manager. The most common ones are
gdm (the default in Gnome),
kdm (same for KDE),
lightdm (originally written for Ubuntu’s Unity DE) and
lxdm (for LXDE). There also exist a bunch of arguably simpler terminal-based display managers like
But for most users a full featured display manager may be a bit too much bloat. You can achieve the same functionality by using the default shell login and a single command. Everything in this post applies only to X11.
If you are the only user of your computer, you may not need a display manager at all. This has the advantages of removing complexity, sparing a few MB from your drive, getting rid of an
systemd task, and being in control of what exactly happens when X starts.
If you have no display manager configured in your init system, after boot you will be presented with the default login shell. Use that to perform your login. After that you enter your system in terminal mode, in one of the
Now we need to start the X window system, and our desktop environment or window manager of choice with it. To do so, we need to look at the
We have two utilities that will launch the X server for us. The first is
xinit, and the second is
startx. In reality,
startx is nothing but a wrapper script around
xinit that adds a few bells and whistles, so I suggest you use only
startx and leave
xinit alone. You can inspect the
startx script easily:
less $(where startx)
So the login sequence goes like this:
- Login using the default shell
As we mentioned before,
xinit, which looks up the
~/.xinitrc file to know what to execute.
~/.xinitrc is a regular script that contains the commands to run when starting X. The final command should run the DE or WM. An example of
~/.xinitrc that starts
i3wm file follows:
In the listing above, we start
i3wm with the line
exec i3. The rest of the file can be as complex as you want it to be.
Set your DPI in
If you use a special display density (DPI) setting, you should make sure to include a call to
xrdb with your
~/.Xresources file. In my case, I use a 4K display, so I set a DPI of 192 in my
!-------------------------------------------- ! Custom DPI !-------------------------------------------- Xft.dpi: 192 Xft.autohint: 0 Xft.lcdfilter: lcddefault Xft.hintstyle: hintfull Xft.hinting: 1 Xft.antialias: 1 Xft.rgba: rgb
You can check that this configuration file is sourced correctly by querying the dots per inch setting of your system:
$ xdpyinfo | grep dots resolution: 192x192 dots per inch
In this post we have seen how to configure our system to login without a display manager. I would argue this is a good practice, especially if you are the only user, as it removes unnecessary complexity and failure points.