Merge pull request #8945 from geekpi/master

translated
This commit is contained in:
geekpi 2018-05-28 08:56:01 +08:00 committed by GitHub
commit 1025c335a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 82 additions and 82 deletions

View File

@ -1,3 +1,5 @@
translating---geekpi
Audacity quick tip: quickly remove background noise
======

View File

@ -1,82 +0,0 @@
translating---geekpi
Starting user software in X
======
There are currently many ways of starting software when a user session starts.
This is an attempt to collect a list of pointers to piece the big picture together. It's partial and some parts might be imprecise or incorrect, but it's a start, and I'm happy to keep it updated if I receive corrections.
### x11-common
`man xsession`
* Started by the display manager for example, `/usr/share/lightdm/lightdm.conf.d/01_debian.conf` or `/etc/gdm3/Xsession`
* Debian specific
* Runs scripts in `/etc/X11/Xsession.d/`
* `/etc/X11/Xsession.d/40x11-common_xsessionrc` sources `~/.xsessionrc` which can do little more than set env vars, because it is run at the beginning of X session startup
* At the end, it starts the session manager (`gnome-session`, `xfce4-session`, and so on)
### systemd --user
* <https://wiki.archlinux.org/index.php/Systemd/User>
* Started by `pam_systemd`, so it might not have a DISPLAY variable set in the environment yet
* Manages units in:
* `/usr/lib/systemd/user/` where units provided by installed packages belong.
* `~/.local/share/systemd/user/` where units of packages that have been installed in the home directory belong.
* `/etc/systemd/user/` where system-wide user units are placed by the system administrator.
* `~/.config/systemd/user/` where the users put their own units.
* A trick to start a systemd user unit when the X session has been set up and the DISPLAY variable is available, is to call `systemctl start` from a `.desktop` autostart file.
### dbus activation
* <https://dbus.freedesktop.org/doc/system-activation.txt>
* A user process making a dbus request can trigger starting a server program
* For systems debugging, is there a way of monitoring what services are getting dbus activated?
### X session manager
* <https://en.wikipedia.org/wiki/X_session_manager>
* Run by `x11-common`'s `Xsession.d`
* Runs freedesktop autostart .desktop files
* Runs Desktop Environment specific software
### xdg autostart
* <https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html>
* Run by the session manager
* If `/etc/xdg/autostart/foo.desktop` and `~/.config/autostart/foo.desktop` exist then only the file `~/.config/autostart/foo.desktop` will be used because `~/.config/autostart/` is more important than `/etc/xdg/autostart/`
* Is there an ordering or is it all in parallel?
### Other startup notes
#### ~/.Xauthority
To connect to an X server, a client needs to send a token from `~/.Xauthority`, which proves that they can read the user's provate data.
`~/.Xauthority` contains a token generated by display manager and communicated to X at startup.
To view its contents, use `xauth -i -f ~/.Xauthority list`
--------------------------------------------------------------------------------
via: http://www.enricozini.org/blog/2018/debian/starting-user-software/
作者:[Enrico Zini][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.enricozini.org/

View File

@ -0,0 +1,80 @@
在 X 中启动用户软件
======
目前有很多方法可以在开启用户会话时启动软件。
这是一篇试图将所有方法聚集在一起的文章。某些部分可能不精确或不正确,但这是一个开始,如果我收到更正,我很乐意保持更新。
### x11-common
`man xsession`
* 由显示管理器启动,如 `/usr/share/lightdm/lightdm.conf.d/01_debian.conf``/etc/gdm3/Xsession`
* Debian 特定。
* 在 `/etc/X11/Xsession.d/` 中运行脚本。
* `/etc/X11/Xsession.d/40x11-common_xsessionrc` 引用 `~/.xsessionrc` ,它只比设置环境变量能做的多一点,因为它在 X 会话启动时运行。
* 最后,它启动会话管理器(`gnome-session`、`xfce4-session` 等等)。
### systemd --user
* <https://wiki.archlinux.org/index.php/Systemd/User>
* 由 `pam_systemd` 启动,所以它可能在环境变量中没有 DISPLAY 变量设置。
* 管理单元:
* `/usr/lib/systemd/user/` 由已安装的软件包提供的单元。
* `~/.local/share/systemd/user/` 由安装在家目录的软件包提供的单元。
* `/etc/systemd/user/` 由系统管理员提供的系统范围的用户的单元。
* `~/.config/systemd/user/` ,用户自己放置的单元。
* 设置 X 会话并使用 DISPLAY 变量时,启动 systemd 用户单元的技巧是从 `.desktop` 自启动文件调用 `systemctl start`
### dbus activation
* <https://dbus.freedesktop.org/doc/system-activation.txt>
* 进行 dbus 请求的用户进程可以触发启动服务器程序。
* 对于系统调试,有没有一种方法可以监控哪些服务正在启动 dbus
### X 会话管理器
* <https://en.wikipedia.org/wiki/X_session_manager>
* 由 `x11-common``Xsession.d` 运行。
* 运行 freedesktop autostart .desktop 文件。
* 运行桌面环境特定的软件。
### xdg autostart
* <https://specifications.freedesktop.org/autostart-spec/autostart-spec-latest.html>
* 由会话管理器运行
* 如果存在 `/etc/xdg/autostart/foo.desktop``~/.config/autostart/foo.desktop` ,那么只会使用 `~/.config/autostart/foo.desktop`,因为 `~/.config/autostart/``/etc/xdg/autostart/` 更重要。
* 是否有顺序或者并行?
### 其他启动笔记
#### ~/.Xauthority
要连接到 X 服务器,客户端需要从 `~/.Xauthority` 发送一个令牌,这证明他们可以读取用户的隐私数据。
`~/.Xauthority` 包含显示管理器生成的一个令牌,并在启动时传递给 X。
要查看它的内容,请使用 `xauth -i -f ~/.Xauthority list`
--------------------------------------------------------------------------------
via: http://www.enricozini.org/blog/2018/debian/starting-user-software/
作者:[Enrico Zini][a]
选题:[lujun9972](https://github.com/lujun9972)
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]:http://www.enricozini.org/