ArchWiki / Xprofile
ArchWiki / Xprofile
es:Xprofile ja:Xprofile pt:Xprofile ru:Xprofile zh-hans:Xprofile
An xprofile file, ~/.xprofile and /etc/xprofile, allows you to execute commands at the beginning of the X user session - before the window manager is started.
The xprofile file is similar in style to xinitrc.
Compatibility
The xprofile files are natively sourced by the following display managers:
GDM -
/etc/gdm/XsessionLightDM -
/etc/lightdm/XsessionLXDM -
/etc/lxdm/XsessionSDDM -
/usr/share/sddm/scripts/Xsession
Sourcing xprofile from a session started with xinit
It is possible to source xprofile from a session started with one of the following programs:
startxxinitAny other Display manager which uses
~/.xsessionor~/.xinitrc
All of these execute, directly or indirectly, ~/.xinitrc or /etc/X11/xinit/xinitrc if it does not exist. That is why xprofile has to be sourced from these files.
#!/bin/sh
# Make sure this is before the 'exec' command or it won't be sourced.
[ -f /etc/xprofile ] && . /etc/xprofile
[ -f ~/.xprofile ] && . ~/.xprofile
...~/.xinitrc and /etc/X11/xinit/xinitrcConfiguration
Firstly, create the file ~/.xprofile if it does not exist already. Then, simply add the commands for the programs you wish to start with the session. See below:
tint2 &
nm-applet &~/.xprofile