Can someone tell me what differents between starting graphical user interface using startx command (which xinitrc contains exec gnome-session or exec xfce4-session) and using an display manager? And can you explain me what the session in gnome-session or xfce4-session mean?

1 Answer 1


This is just different methods of starting X system and DE/WM. When you add entries to ~/.xinitrc you indicate what to run when program startx (or xinit) starts, which launches X11. I think that session just means that you're going to run session of selected desktop environment, it's just a name for executable files (scripts) that developers chose (e.g. KDE doesn't have the word session in /usr/local/bin/startkde). So simply .xinitrc is a bash script that runs other scripts. The "exec" prefix to this command tells the shell that this is the last command, so the shell does not need to wait to run a next command (exec is optional in this case, since e.g. gnome-session does not finish until you logout from GNOME).

When you enable display manager it can read available sessions from /usr/share/xsessions/ directory. It contains standard desktop entry files for each DM/WM (configuration files describing how a particular program is to be launched, how it appears in menus, etc). And then it can start session that you choose in graphical interface.

Guide to X11/Starting sessions | Display managers arch wiki | X terminology

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .