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/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:

All of these execute, directly or indirectly,  or 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:

gollark: There's no red underline either.
gollark: ```You try to write the name, but several characters disappear as you write, so you decide to try something else.The name you tried to use contains invalid characters. Names can only contain letters, numbers, spaces, apostrophes, and dashes.-XTypedHoles```What?!
gollark: I would automate it, but TJ09.
gollark: I forgot to get lots of shards this week. Instead of actual playing, I can just click a few buttons mindlessly and get my shard cap filled.
gollark: By "massbreed" I mean "breed my ~10"; not very "mass".
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.