Usually, there is a system-wide default Xsession script, which will normally first check if a user has their own $HOME/.xsession
or similar, and will use it instead if it exists; otherwise the system-wide script will implement some system-wide default.
The location of a system-wide default script may depend on which X11 Display Manager (effectively the GUI login screen, e.g. xenodm
) implementation you're currently using, or if you are using startx
to start the GUI session after text-mode login.
- if you are using
startx
, the system-wide session script is either /usr/X11R6/lib/sys.startxrc
or /etc/X11/xinit/xinitrc
in this order (first one that exists will be used). See: man startx
- if you are using
xenodm
, the system-wide default session script would be /etc/X11/xenodm/Xsession
. See: OpenBSD FAQ.
- if you are using some other display manager (usually named like
*dm
), you should check its documentation.
Note that $HOME/.xsession
and $HOME/.xsession~
are two different files, and the ~
suffix is a classic Unix text editor backup file indicator, i.e. .xsession~
can be expected to be a previous/backup version of .xsession
if it exists.
#!/bin/sh
andcwm