GNOME/Guide/zh-cn

GNOME 是一个流行的能够启动 Xorg 和 Wayland 会话的 桌面环境. 本指南 Article description::尝试描述 GNOME 的所有方面，包括安装、配置和使用.

从 3.30 版本开始，Gentoo 上的 GNOME 能够再次在 OpenRC 上运行. 详情参见 的 blog post.

项目
GNOME 项目是一个自由的软件组织，它致力于 GNOME 的发展，Unix/Linux 桌面套件和开发平台. GNOME 基金会协调发展 GNOME 项目的其他方面.

软件
GNOME 是一个桌面环境和一个开发平台. 这款自由软件是包括 Canonical (Ubuntu) 和 Red Hat（Red Hat Linux、Fedora、Centos）在内的多个行业领导者的首选桌面.

社区
像任何大的自由软件项目,GNOME有着广泛的用户和开发基地. GNOME Planet 是一个受GNOME黑客和贡献者欢迎的博客汇聚，而 developer.gnome.org is for the GNOME developers. GNOME Library 包含一个巨大的GNOME终端用户资源列表. WOGUE 也是一个受欢迎的GNOME-related新闻汇聚，

准备
从历史上看，Xorg 显示服务器是 Linux 上所有桌面环境的标准显示基础. 对于 GNOME 3 及更高版本，已经开始转向更新的 Wayland 显示服务器协议. NVIDIA 以外的系统在 Wayland 上运行 GNOME 会话没有问题.

也就是说，退一步讲，最好先阅读并按照 Xorg 指南 中设置 X 环境的说明.

根据 GNOME 上游的说法，GNOME 3 是用 systemd 初始化系统编写的. 因此，systemd 用户最好从 systemd 文章中阅读并遵守所有必要的内核设置.

Profile
在安装 GNOME 套件之前，编辑系统的 USE 变量是个好主意. Gentoo 开发人员提供了一个 GNOME 特定配置文件，以帮助对 GNOME 软件堆栈进行系统范围的调整. 在安装 GNOME 之前选择最新且稳定的 GNOME 特定配置文件.

OpenRC
使用 logind 的 OpenRC 用户可以选择此特定配置文件：

systemd
systemd 用户将会选择以下 profile：

Make sure that,  , and   are in the USE variable located in. It is recommended to enable support for D-Bus system-wide. systemd includes this system message bus.

Emerge
一旦完成,就由emerge GNOME来安装GNOME：

“最小化”GNOME安装,，该选项提供了一个轻量级的GNOME安装没有额外的工具,但是安装一个完整的GNOME，它提供了所有你可能需要的额外的软件包.

这将需要一段时间，所以要开始阅读我们 wiki 中的其他部分. 准备好了么？很好，现在更新环境变量：

接下来剩余的服务和用户组将被清除.

验证  组是否存在. 如果是，建议让每个 GNOME 用户成为该组的成员，但这是可选的（该组不再常见）.

取代  在接下来的命令与每一个GNOME用户的用户名:

第一印象
现在是时候看看什么是刚刚构建的. 退出root 终端并以普通用户身份登录. 下一步骤是配置会话管理器，使用GNOME 命令来调用(请看using startx 在Xorg guide的更多信息).

OpenRC
For OpenRC systems, elogind is a dependency of GDM and must be started for GDM to run properly:

Next add display-manager-init to the default runlevel and start the service:

In set DISPLAYMANAGER to "gdm"

To start on boot, add display-manager to the default runlevel:

To start GDM either reboot or start it with rc immediately:

systemd
在引导时启动 GDM：

要立即启动 GDM，运行：

另一个建议是激活 Network Manager，以防没有其他网络管理服务被激活.

使用 startx
Exit the root shell and log in as a regular user. The next step is to configure the session manager to run GNOME when the the command is invoked (see using startx in the Xorg guide for more information).

从 gnome-base/gnome-session-2.26.2 开始，当使用 方法启动桌面时，用户需要预先添加 XDG_MENU_PREFIX 变量以获取 GNOME 菜单. 如果 没有被使用，它将被自动处理；无需额外的配置.

现在开始运行安装的图形环境:

如果一切顺利GNOME，我们高兴的问候您. 祝贺你成功设置GNOME!

Mixed localization
It could be general to have  as the global default locale, with a different one for the desktop. This can be achieved by add settings:

Then choose the region for locale in gnome-setting-center, or via command:

Log out, make sure the old session is killed and re-login, these settings will be applied to the new session.

To override session's locale for terminal in gnome, add:

调整 GNOME
For extra configuration options in GNOME 40 install the package. The tweak tool allows customization at a deeper level than the standard Settings frame.

Advanced tweaking
Advanced tweaking for GNOME can be performed from the command line via the or  commands or graphically via. All modifiable settings are accessible using these tools. For more information, see upstream's documentation.

GNOME 3 中的小部件
By default on Gentoo GNOME 40 does not support widgets. For users who wish to obtain widget functionality a separate package is available:

安装 shell 扩展后，可以使用 来控制全局级别的默认值：

通过网络浏览器启用点击安装 Shell 扩展
For web browsers such as Google Chrome, Chromium, and Vivaldi be sure to get the required browser add-on through the Chrome store: https://chrome.google.com/webstore/detail/gphhapmejobijbbhgpjhcjognlahblep

Firefox users can get it here: https://addons.mozilla.org/firefox/addon/gnome-shell-integration/

Opera users will have to snag it here: https://addons.opera.com/extensions/details/gnome-shell-integration/

After the add-on has been installed for the browser of choice, a backend must also be emerged:

It should now be possible to install, manage, and uninstall shell extensions at https://extensions.gnome.org/

If things are not working as expected check the upstream installation instructions for news.

Non-root user authentication for dialogs
Certain GNOME dialogs such as Printers, adding wireless networks, and Users require administrator authentication. This is handled through and operates independently from. By default in Gentoo, the root account is the only administrator, and so even if a user account can run root commands through, authentication in these GNOME dialogs will fail.

If you would like all users of the group to be administrators, create a copy of  starting with a number lower than 50, and edit the line  to the following:

The Polkit wiki page provides more details on rules configuration.

GNOME Hotspot
In order for gnome-hotspot to work, your wireless card must support AP (access point) infrastructure mode. The following package USE flags are also needed:

此外，还需要以下内核选项：

卸载
A possible way to completely remove a GNOME installation is by explicitly uninstalling the package, then cleaning the dependencies of that package.

为了做到这一点，请确保主 ebuild 存储库已同步：

接下来，运行全局更新使系统是全新的：

卸载 GNOME 基础包：

最后，清理系统：

GNOME 现已删除.

登录失败并显示消息 "Oh no something has gone wrong"
One source of this error can be the permissions for the video device. When logging in fails and a message appears that says "Oh no, something has gone wrong", then try to become a member of the group. Add the user to the video group with like so:

Wayland 会话上的 GNOME 未与 NVIDIA 一起启动
Attempting to launch GNOME on Wayland sessions is a known issue. Unfortunately the NVIDIA binary blob drivers are not presently compatible with Wayland. Systems that simply have the NVIDIA binary blob driver installed, but are not using it can see this workaround.

GNOME built-in screen recorder is not working
GNOME's screen recorder uses vp8 codec which is developed by Google. The recorder needs this codec to record the desktop. It can be enabled it via the the  USE flag in either the  or  files.

GNOME and Pinentry not working with GPG
For example when using Evolution to sign emails with PGP, the private key needs to be decrypted. If this key has a password, a Pinentry dialogue trys to open. To enable the Gtk version, these configuration files need to be edited.

外部资源

 * https://github.com/dantrell/gentoo-project-gnome-without-systemd - 没有 systemd 的 GNOME