跳转至内容

xprofile

来自 ArchWiki

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

xprofile 文件在风格上类似于 xinitrc

兼容性

xprofile 文件被以下显示管理器原生 sourced:

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

从 xinit 启动的会话中 sourced xprofile

可以通过以下程序之一启动的会话中 sourced xprofile:

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

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

© . This site is unofficial and not affiliated with Arch Linux.

Content is available under GNU Free Documentation License 1.3 or later unless otherwise noted.