xprofile

出自 ArchWiki
(重定向自 .xprofile

xprofile 文件,~/.xprofile/etc/xprofile,允许您在 X 用户会话开始时(在窗口管理器启动之前)执行命令。

xprofile 文件的风格类似于 xinitrc

兼容性

xprofile 文件由以下显示管理器原生引用:

  • GDM - /etc/gdm/Xsession
  • LightDM - /etc/lightdm/Xsession
  • LXDM - /etc/lxdm/Xsession
  • SDDM - /usr/share/sddm/scripts/Xsession

从 xinit 启动的会话中引用 xprofile

可以从以下程序之一启动的会话中引用 xprofile:

所有这些程序都直接或间接地执行 ~/.xinitrc/etc/X11/xinit/xinitrc(如果该文件不存在)。这就是为什么 xprofile 必须从这些文件中引用的原因。

~/.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

...

配置

首先,创建文件 ~/.xprofile(如果它尚不存在)。然后,只需添加您希望在会话开始时启动的程序的命令。请参见下文

~/.xprofile
tint2 &
nm-applet &