Xprofile: Difference between revisions
m (add the Chinese page) |
(Remove mention of KDM and SLiM, it's a long time they are outdated and not maintained.) |
||
(15 intermediate revisions by 8 users not shown) | |||
Line 1: | Line 1: | ||
{{Lowercase title}} | {{Lowercase title}} | ||
[[Category:X | [[Category:X server]] | ||
[[es:Xprofile]] | [[es:Xprofile]] | ||
[[ja:Xprofile]] | [[ja:Xprofile]] | ||
[[pt:Xprofile]] | |||
[[ru:Xprofile]] | [[ru:Xprofile]] | ||
[[zh- | [[zh-hans:Xprofile]] | ||
{{Related articles start}} | {{Related articles start}} | ||
{{Related|xinitrc}} | {{Related|xinitrc}} | ||
{{Related articles end}} | {{Related articles end}} | ||
An xprofile file, {{ic|~/.xprofile}} and {{ic|/etc/xprofile}}, allows you to execute commands at the beginning of the X user session - before the [[ | An xprofile file, {{ic|~/.xprofile}} and {{ic|/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 | The xprofile file is similar in style to [[xinitrc]]. | ||
== Compatibility == | == Compatibility == | ||
The xprofile | The xprofile files are natively sourced by the following display managers: | ||
* [[GDM]] - {{ic|/etc/gdm/Xsession}} | * [[GDM]] - {{ic|/etc/gdm/Xsession}} | ||
* [[LightDM]] - {{ic|/etc/lightdm/Xsession}} | * [[LightDM]] - {{ic|/etc/lightdm/Xsession}} | ||
* [[LXDM]] - {{ic|/etc/lxdm/Xsession}} | * [[LXDM]] - {{ic|/etc/lxdm/Xsession}} | ||
* [[SDDM]] - {{ic|/usr/share/sddm/scripts/Xsession}} | |||
=== Sourcing xprofile from a session started with xinit === | === Sourcing xprofile from a session started with xinit === | ||
It is possible to source xprofile from a session started with one of the following programs: | It is possible to source xprofile from a session started with one of the following programs: | ||
* {{ic|startx}} | * {{ic|startx}} | ||
* {{ic|xinit}} | * {{ic|xinit}} | ||
* [[XDM]] | * [[XDM]] | ||
* Any other [[Display manager]] which uses {{ic|~/.xsession}} or {{ic|~/.xinitrc}} | * Any other [[Display manager]] which uses {{ic|~/.xsession}} or {{ic|~/.xinitrc}} | ||
All of these execute, directly or indirectly, {{ic|~/.xinitrc}} | All of these execute, directly or indirectly, {{ic|~/.xinitrc}} or {{ic|/etc/X11/xinit/xinitrc}} if it does not exist. That is why xprofile has to be sourced from these files. | ||
{{hc|~/.xinitrc and /etc/X11/xinit/ | {{hc|~/.xinitrc and /etc/X11/xinit/xinitrc| | ||
#!/bin/sh | #!/bin/sh | ||
# Make sure this is before the 'exec' command or it won't be sourced. | # Make sure this is before the 'exec' command or it won't be sourced. | ||
[ -f /etc/xprofile ] && | [ -f /etc/xprofile ] && . /etc/xprofile | ||
[ -f ~/.xprofile ] && | [ -f ~/.xprofile ] && . ~/.xprofile | ||
... | ... | ||
}} | }} | ||
== Configuration == | == Configuration == | ||
Firstly, create the file {{ic|~/.xprofile}} if it does not exist already. Then, simply add the commands for the programs you wish to start with the session. See below: | Firstly, create the file {{ic|~/.xprofile}} if it does not exist already. Then, simply add the commands for the programs you wish to start with the session. See below: | ||
{{hc|~/.xprofile| | {{hc|~/.xprofile| | ||
tint2 & | tint2 & | ||
nm-applet & | nm-applet & | ||
}} | }} |
Latest revision as of 13:55, 7 September 2018
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/Xsession
- LightDM -
/etc/lightdm/Xsession
- LXDM -
/etc/lxdm/Xsession
- SDDM -
/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:
startx
xinit
- XDM
- Any other Display manager which uses
~/.xsession
or~/.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.
~/.xinitrc and /etc/X11/xinit/xinitrc
#!/bin/sh # Make sure this is before the 'exec' command or it won't be sourced. [ -f /etc/xprofile ] && . /etc/xprofile [ -f ~/.xprofile ] && . ~/.xprofile ...
Configuration
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:
~/.xprofile
tint2 & nm-applet &