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 &