GNOME/指南

From Gentoo Wiki
< GNOME
Jump to: navigation, search
This page is a translated version of the page GNOME/Guide and the translation is 29% complete.

Outdated translations are marked like this.
Other languages:
English • ‎español • ‎français • ‎polski • ‎русский • ‎中文(中国大陆)‎ • ‎日本語 • ‎한국어
 As of March 23, 2016, the information in this article is probably outdated. You can help the Gentoo community by verifying and updating this article.
Resources

GNOME是一个受欢迎的desktop environment. 本指南试图描述GNOME的各个方面,包括安装,配置,使用等等!

Since version 3.30, GNOME on Gentoo is able to once again run on OpenRC.[1] See Mart Raudsepp (leio)'s blog post for more detail.

什么是 GNOME?

项目

GNOME project 是一个免费的软件项目,它致力于GNOME的发展,Unix / Linux桌面套件和开发平台。 GNOME Foundation 协调发展和GNOME项目的其他方面。

软件

GNOME桌面环境和开发平台。这片自由软件的桌面选择几个行业领导者。有趣的是同时针对业务用户、家庭用户和开发人员开发。

社区

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

准备

Historically speaking, the Xorg display server was the standard display base for all desktop environments on Linux. With GNOME 3 and beyond, a shift to the Wayland, a newer display server protocol, has begun. Systems other than NVIDIA will have no problem running GNOME sessions over Wayland.

That said, as a general fall back, it is a good idea to first read and follow the instructions in the Xorg guide to setup a X environment.

According to GNOME upstream, GNOME 3 is written with the systemd init system in mind. Because of this, it is a good idea for systemd users to read and comply with all necessary kernel settings from the systemd article.

安装

在安装之前GNOME,编辑系统的USE是一个好主意。确保X, gtk,和 gnome USE位于/etc/portage/make.conf的变量。 If support for dbus 增加他到 USE flags (dbus是 Gnome 广泛使用的系统消息总线),如果不需要 KDE支持, 移除USE 配置中的qt4kde , USE 变量可以添加一个负号 (-) 在他们前面。看下面的例子,这是正确使用减号的方法。

OpenRC users using logind can select this profile:

root #eselect profile set default/linux/amd64/17.1/desktop/gnome

systemd 用户将会选择以下 profile:

root #eselect profile set default/linux/amd64/17.1/desktop/gnome/systemd

Make sure that X, gtk, and gnome are in the USE variable located in /etc/portage/make.conf. It is recommended to enable support for D-Bus system-wide. systemd includes this system message bus. Add systemd to the USE variable as well (D-Bus is a system message bus that GNOME uses extensively). If no KDE support is required, remove qt5 and kde from USE. USE flags can be removed by adding a minus sign (-) in front of them. See the example below for the minus sign used properly.

FILE /etc/portage/make.confGNOME 桌面环境的全局 USE flag 示例
USE="-qt5 -kde X gtk gnome systemd"
附注
当使用 desktop/gnome profile, 这些 USE flags将为你设置。 可以通过运行检查系统的profileeselect profile list. 可以作为root用户运行eselect profile set <profile-name> 修改。 一定要更改 "<profile-name>" 的数字或名称所需的 profile.

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

root #emerge --ask gnome-base/gnome

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

root #emerge --ask gnome-base/gnome-light

这将需要一段时间,所以你可能要开始阅读这些妈妈给你买的,但你却从来没有打开的书。准备好了?很好,现在更新的环境变量:

root #env-update && source /etc/profile

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

验证 plugdev 组存在与否。 如果存在,建议让每一个GNOME用户组的成员,都加入这个组,但这一步是可选的(该组是不常见的)。

root #getent group plugdev
plugdev:x:104:

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

root #gpasswd -a <username> plugdev

第一印象

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

Enabling GDM

Note
Help on troubleshooting issues with GDM can be found in the GNOME/GDM article.

systemd

To start GDM upon boot:

root #systemctl enable gdm.service

To start GDM immediately, run:

root #systemctl start gdm.service
Tip
The following command both enables and starts GDM immediately:
root #systemctl enable --now gdm.service

Another suggestion is to activate Network Manager, in case no other network managing service is activated.

Using 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 startx command is invoked (see using startx in the Xorg guide for more information).

user $echo "exec gnome-session" > ~/.xinitrc

要安装 gnome-base/gnome-session-2.26.2, 用户需要先考虑XDG_MENU_PREFIX变量在使用GNOME菜单 ~/.xinitrc 方法启动桌面 If ~/.xinitrc不被使用它会自动处理;无需额外的配置。

user $sed -i '1i\export XDG_MENU_PREFIX=gnome-' ~/.xinitrc

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

user $startx

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

配置

Tweaking GNOME

For extra configuration options in GNOME 3 install the gnome-extra/gnome-tweak-tool package. The tweak tool allows customization at a deeper level than the standard Settings frame.

Widgets in GNOME 3

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

root #emerge --ask gnome-extra/gnome-shell-extensions

After the shell extensions are installed, eselect can be used to control defaults on a global level:

root #eselect gnome-shell-extensions list
Available extensions (* means enabled for all users by default):
  [1]   alternate-tab@gnome-shell-extensions.gcampax.github.com
  [2]   apps-menu@gnome-shell-extensions.gcampax.github.com
  [3]   auto-move-windows@gnome-shell-extensions.gcampax.github.com
  [4]   drive-menu@gnome-shell-extensions.gcampax.github.com
  [5]   launch-new-instance@gnome-shell-extensions.gcampax.github.com
  [6]   native-window-placement@gnome-shell-extensions.gcampax.github.com
  [7]   places-menu@gnome-shell-extensions.gcampax.github.com
  [8]   screenshot-window-sizer@gnome-shell-extensions.gcampax.github.com
  [9]   user-theme@gnome-shell-extensions.gcampax.github.com
  [10]  window-list@gnome-shell-extensions.gcampax.github.com
  [11]  windowsNavigator@gnome-shell-extensions.gcampax.github.com
  [12]  workspace-indicator@gnome-shell-extensions.gcampax.github.com

Enable click-to-install Shell Extensions through the web browser

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:

root #emerge --ask gnome-extra/chrome-gnome-shell

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 sys-auth/polkit and operates independently from app-admin/sudo. By default in Gentoo, the root account is the only administrator, and so even if a user account can run root commands through sudo, authentication in these GNOME dialogs will fail.

If you would like all users of the group wheel to be administrators, create a copy of /etc/polkit-1/rules.d/50-default.rules starting with a number lower than 50, and edit the line return ["unix-user:0"] to the following:

FILE /etc/polkit-1/rules.d/49-wheel.rulesAdministrator wheel group
polkit.addAdminRule(function(action, subject) {
    return ["unix-group:wheel"];
});

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:

FILE /etc/portage/package.useConnection Sharing and Access Point Support
net-misc/networkmanager connection-sharing
net-wireless/wpa_supplicant ap

In addition, the following kernel options are necessary:

KERNEL NAT options (locations for kernel 4.14)
Networking support (NET [=y])
    Networking options --->
        Network packet filtering framework (Netfilter) (NETFILTER [=y]) --->
            IP: Netfilter Configuration --->
                <*/M> IPv4 NAT (CONFIG_NF_NAT_IPv4)
                <*/M> IPv4 masquerade support
                <*/M> IP tables support (required for filtering/masq/NAT) (IP_NF_IPTABLES [=y])
                <*/M> iptables NAT support

Removal

Unmerge

A possible way to completely remove a GNOME installation is by explicitly uninstalling the gnome-base/gnome package, then cleaning the dependencies of that package.

In order to do this sanely make sure the main ebuild repository has been synced:

root #emerge --sync

Next, run a world update so that the system is fully up-to-date:

root #emerge --ask --update --newuse --deep --with-bdeps=y @world

Unmerge the GNOME base package:

root #emerge --ask --depclean gnome-base/gnome

Finally, depclean the system:

root #emerge --ask --depclean

GNOME should now be removed.

故障排除

Login failure with message "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 video group. Add the user to the video group with gpasswd like so:

root #gpasswd -a <user> video

GNOME on Wayland session is not launching with 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.

外部资源


This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: Lars Strojny,
They are listed here because wiki history does not allow for any external attribution. If you edit the wiki article, please do not add yourself here; your contributions are recorded on each article's associated history page.