Xfce/指南

From Gentoo Wiki
< Xfce
Jump to:navigation Jump to:search
This page is a translated version of the page Xfce/Guide and the translation is 47% complete.
Outdated translations are marked like this.

本指南对 Xfce 进行了广泛的介绍。Xfce 是一个快捷的、轻量级的,功能齐全的桌面环境。

介绍

Xfce桌面环境

Xfce 是类Unix操作系统上的一个快捷、轻量级的桌面环境。它是为生产力而设计的,并且具备很好的可配置性,同时还符合 Freedesktop的规范。

不像 GnomeKDE Plasma 等这些重量级的桌面环境,Xfce占用的系统资源要少得多。另外,它拥有更好的模块性和更少的依赖性;它将占用你更少的磁盘空间和更少的安装时间。

这篇指南将不仅向你说明如何安装和配置一个最小化的Xfce环境,并且还将探索一些可用方案来创建一个功能齐全的桌面环境,保持与Xfce设计思想的一致:轻巧,快速和模块化。

这篇指南的最后的部分列出了一些在升级到新的Xfce版本后需要运行的命令,如果你正在从旧版本升级,请务必遵循。

安装

基础

首先,确定你已经按照 Xorg 指南 一文所说的配置好了Xorg。如果没有的话那么本指南下面的步骤可能无法正常工作。

为了获得最佳体验,应选择具有XFCE所需的许多常用设置的基本桌面配置文件。

amd64 架构的一个例子:

root #eselect profile list
...
  [12]  default/linux/amd64/17.1 (stable)
  [13]  default/linux/amd64/17.1/selinux (stable)
  [14]  default/linux/amd64/17.1/hardened (stable)
  [15]  default/linux/amd64/17.1/hardened/selinux (stable)
  [16]  default/linux/amd64/17.1/desktop (stable)
  [17]  default/linux/amd64/17.1/desktop/gnome (stable)
  [18]  default/linux/amd64/17.1/desktop/gnome/systemd (stable)
  [19]  default/linux/amd64/17.1/desktop/plasma (stable)
  [20]  default/linux/amd64/17.1/desktop/plasma/systemd (stable)
  [21]  default/linux/amd64/17.1/developer (stable)
  [22]  default/linux/amd64/17.1/no-multilib (stable)
  [23]  default/linux/amd64/17.1/no-multilib/hardened (stable)
  [24]  default/linux/amd64/17.1/no-multilib/hardened/selinux (stable)
  [25]  default/linux/amd64/17.1/systemd (stable)
...

安装

现在你已经在 /etc/portage/make.conf 设置好了你的USE标志,是时候安装 Xfce 了。

root #emerge --ask xfce-base/xfce4-meta

如果需要,把系统上的一般用户(们)加到cdromcdrwusb 组里,这样他/她们便能挂载和使用照相机、光驱和U盘等之类的设备。

root #for x in cdrom cdrw usb ; do gpasswd -a username $x ; done

更新系统的环境变量:

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

要在新的桌面环境下继续工作,一个图形终端是有必要的。x11-terms/xfce4-terminal 是一个很好的选择,因为它是为 Xfce 定制的。使用如下命令安装终端:

root #emerge --ask x11-terms/xfce4-terminal

配置

启动Xfce

现在 Xfce 已经安装完毕,接着我们将把它设置成我们默认的桌面环境,一旦我们执行startx便可进入。将你的 root 用户退出然后以普通用户的身份登录。

user $echo "exec startxfce4" > ~/.xinitrc

现在输入startx来启动你的图形环境:

user $startx


会话和启动

如果你已经(或者打算)安装一些流行的 Gnome 或 KDE 软件,比如 k3b, nautilus, kmail, evolution 等等,那么你要确定 Xfce 在启动时为这些程序启动了相应的服务。依次点击 Menu --> Settings --> Sessions & Startup。在 Advanced 标签里面,选择相应的复选框。这样可能会稍微增加 Xfce 启动的时间,但是会减少加载 KDE 和 Gnome 应用程序的时间。

Xfce能够保存你每次会话所做设置和运行的程序,这根据你在Sessions & Startup 菜单的General标签页的设置而定。当你退出登录时,既可以让Xfce自动保存也可以让Xfce每次都提示你是否要保存。当你想撤销错误的设置时这项功能尤其有用。意外关闭了面板该怎么办?只要在被问到是否要保存当前会话时选择否,那么下次你启动Xfce时,你原来的桌面就又回来了。想要在下次登录时自动加载你打开的浏览器、终端和邮件客户端吗?只要在退出时保存你的会话。

附加的应用程序

每个用户应考虑安装以下有用的应用程序和实用程序中的一些或全部:

root #emerge --ask xfce-extra/xfce4-pulseaudio-plugin xfce-extra/xfce4-taskmanager x11-themes/xfwm4-themes app-office/orage app-editors/mousepad xfce-extra/xfce4-power-manager x11-terms/xfce4-terminal xfce-base/thunar
Package Description
xfce-extra/xfce4-pulseaudio-plugin Pulseaudio volume control (Others can install media-sound/volumeicon or similar tray audio mixer).
xfce-extra/xfce4-taskmanager Displays a list of all running programs, and the CPU and memory consumption each one takes up. By right-clicking an item, you can kill a misbehaving application, pause and restart it, or even alter its run time priority, which will fine-tune how much of a demand it puts on the system's resources.
x11-themes/xfwm4-themes Adds several window manager themes. Additional icon themes, such as x11-themes/tango-icon-theme, are available to round out the desktop.
app-editors/mousepad Is a bare bones text editor that starts up extremely quickly.
xfce-base/xfce4-power-manager An application to monitor and manage power usage. This is especially important for laptops! The power manager allows user to adjust screen brightness, choose maximum performance or battery-saving modes, and setup hibernate, suspend, and shutdown actions when the lid is shut or buttons are pressed. xfce4-power-manager can be set to provide warning when the battery reaches certain levels, or even turn off the machine. The application comes with a couple of helpful panel plugins to display battery/charging status, and a brightness control.
x11-terms/xfce4-terminal An X11 terminal emulator, far more configurable and useful than the barebones xterm. xfce4-terminal supports Unicode text, color schemes, pseudo-transparency and hardware-accelerated transparency via Xfce's built-in compositor, all out-of-the-box. Just make sure that the default action on the terminal launcher of the panel runs /usr/bin/Terminal instead of xterm. Right-click the launcher and choose Properties to change the command.
xfce-base/thunar Xfce's default graphical file manager. It is fast yet quite powerful, can support several plugins for even more functionality; just install them with emerge. These plugins include: xfce-extra/thunar-archive-plugin which lets users create and extract archive files using the right-click menu. It provides a handy front-end for graphical archiving applications such as xarchiver and file-roller.
xfce-base/tumbler Lets users preview certain types of files from within Thunar, such as images and fonts.
xfce-base/thunar-volman Automatically manages removable media and drives.
media-video/parole A simple Xfce4 media player using GStreamer.
Package Description
xfce-extra/xfce4-pulseaudio-plugin Pulseaudio音量控制。(xfce4-mixer已弃用并从Gentoo中删除。可以安装media-sound/volumeicon或类似的托盘混音器)
xfce-extra/xfce4-taskmanager 显示所有正在运行的程序的列表,以及每个程序占用的CPU和内存消耗。 通过右键单击项目,您可以杀死运行异常的应用程序,暂停和重新启动它,甚至更改其运行时优先级,这可以调整其对系统资源的需求量。
x11-themes/xfwm4-themes 添加几个窗口管理器主题。 您可能想要添加更全面的图标主题,例如 x11-themes/tango-icon-theme只是为了整理您的桌面。
app-office/orage 一个简单,方便的日历。
app-editors/mousepad 是一个简单的文本编辑器,启动非常快。
xfce-extra/xfce4-power-manager 监视和管理电源使用情况的应用程序。 这对笔记本电脑特别重要! 电源管理器允许用户调节屏幕亮度,选择最大性能或节电模式,并在盖子关闭或按下按钮时设置休眠,暂停和关闭操作。xfce4-power-manager 可设置为在电池达到一定水平时提供警告,甚至关闭机器。 该应用程序配有一些有用的面板插件来显示电池/充电状态,以及亮度控制。
x11-terms/xfce4-terminal 一个X11终端,比准系统更可配置和有用 xterm。xfce4终端支持Unicode文本,配色方案,伪透明度和硬件加速透明度,通过Xfce的内置合成器,所有开箱即用。 只需确保在面板的终端启动器上运行默认操作 /usr/bin/Terminal取代 xterm。 右键单击启动器并选择Properties来更改命令。
xfce-base/thunar Xfce的默认图形文件管理器。 它速度快,功能强大,可以支持多个插件,实现更多功能;使用 emerge进行安装。他的组件包括xfce-extra/thunar-archive-plugin他允许用户使用右键单击菜单创建和提取归档文件。他提供了一个图形化的front-end 包:xarchiverfile-roller.
xfce-extra/tumbler 允许用户从Thunar内预览某些类型的文件,例如图像和字体。
xfce-extra/thunar-volman manages自动挂载可移动介质和驱动器。

Desktop applications

尽管 app-editors/mousepad 作为一个初级的文本编辑器已经是相当好了,但如果你需要一个功能齐全的文字处理器,同时又不想要臃肿的LibreOffice,那么装上app-office/abiword试试。AbiWord是一个更加轻快,并且与业界标准文档类型完全互通的文字处理工具。

需要一个好用的电子邮件客户端/新闻阅读器,但又不需要像 mail-client/thunderbird或者mail-client/evolution这样庞大的?安装mail-client/claws-mail试试。

在网上聊天方面,net-irc/irssi 是一个优秀的IRC客户端,它运行于终端里,小巧并且配置性极好。如果你更倾向于想要一个包含了所有聊天协议的客户端,那么你可能想要emergenet-im/pidgin

如果你需要电影和音乐播放器,那没有比 media-video/mplayermedia-sound/exaile更好的了。几乎所有格式的多媒体文件它们都能很好地播放.

最后,你还需要一个浏览器。几乎所有的图形化浏览器都要比你大多数的桌面应用程序需要更多的资源。尽管如此,Firefox和Midori依然是一个很好的选择。除此之外,你可能发现Opera速度也是相当快的。但是Opera并不像Firefox一样可在多种处理器架构上使用,并且它有更多的依赖关系,除非你用USE标记忽略它们。

root #emerge --ask www-client/firefox
root #emerge --ask www-client/midori
root #emerge --ask www-client/opera

面板插件

Portage 里面已经有许多面板插件了;用 emerge --search xfce自己查看。尽管这些插件的名字中大部分都是带有自我解释含义的,但是有一些插件还是值得引起我们注意的,因为它们非常有用。要使用它们,只要简单的 emerge 它们。当你右击面板时便能看到它们已经被加到 Add New Items 菜单里面。

Package Description
xfce-extra/xfce4-battery-plugin 适合笔记本电脑用户。 它显示电池百分比,剩余时间,电源(交流或电池),风扇状态,警告,甚至可以配置为在特定功率级别执行命令。 此功能可用于在电池电量几乎耗尽时将笔记本电脑置于休眠模式。
xfce-extra/xfce4-verve-plugin 嵌入面板的一个小命令行。 它比打开终端运行命令更快。
xfce-extra/xfce4-mount-plugin 提供一种方便的方法,只需点击鼠标即可安装/etc/fstab中列出的设备。
xfce-extra/xfce4-sensors-plugin 允许用户监视硬件传感器,例如CPU温度,风扇RPM,硬盘驱动器温度,主板电压等。

| xfce-extra/xfce4-battery-plugin | Perfect for laptop users. It displays battery percentage, time remaining, power source (AC or battery), fan status, warnings, and can even be configured to execute commands at certain power levels. This feature can be used to put the laptop into hibernate mode when the battery is almost exhausted. |-

| xfce-extra/xfce4-verve-plugin | A small command line embedded into the panel. It is quicker than opening up a terminal to run a command. |-

| xfce-extra/xfce4-mount-plugin | Provides a handy method of mounting devices listed in /etc/fstab just by clicking the mouse. |-

| xfce-extra/xfce4-sensors-plugin | Lets users monitor hardware sensors, such as CPU temperature, fan RPM, hard drive temp, motherboard voltage, and more. |-

|}

图形界面登录

还记得我们添加startxfce4这一行到~/.xinitrc文件的时候吗?要进入你的桌面,你所需要做的就是在登录以后敲入startx 。如果你喜欢完全基于文本启动和登录的话这种方法是很好的。否则,让我们使用一个显示管理器,它会在你系统引导后自动启动Xfce(这样你就能用图形化界面登录)。

首先,让我们确定下系统启动后加载了Xfce:

root #rc-update add dbus default
root #rc-update add xdm default

这还远没有结束。我们还要挑选一个显示管理器然后设置一些合适的变量。尽管在Portage中有若干显示管理器可以选择,但在这篇指南中,我们将坚持 SLiM——简单登录管理器。

XSESSION="Xfce4"添加到文件/etc/env.d/90xsession,这样SLiM就能自动启动你的Xfce了。

root #echo XSESSION=\"Xfce4\" > /etc/env.d/90xsession
root #env-update && source /etc/profile

美化桌面

对桌面外观稍微设置下是大有裨益的。Xfce 拥有人们期望的一个现代桌面环境的全部设置选项,字体反锯齿设置、颜色模板、大量的窗体装饰物、主题,等等还有很多。如果这还不够,那安装第三方的主题、图标集、鼠标光标主题还有壁纸也很容易。

Gentoo 网站上面已收集了一批包含了各种分辨率的漂亮的 Gentoo 壁纸。如果你在寻找图标集和完整的 Xfce 主题,Xfce-Look上面有很多。还有件重要的事情要记住,对于你下载的任何第三方美化包,通常需要先解压,然后再安装到合适的目录里。如果你想让你系统上所有的用户都能使用这些主题和图标集,那么把图标集安装到/usr/share/icons/,主题安装到/usr/share/themes/。如果仅供当前用户使用,那么把主题和图标集分别安装到~/.themes/和~/.icons/

最后,Xfce 还拥有自己内建的混色工具来管理窗口的透明化。你可以在 Menu --> Settings --> Window Manager 这里找到这个选项。为了达到最好的效果,你需要让你的显卡使用支持硬件加速渲染的驱动。确认你安装 xfce-base/xfwm4 时加入了 xcomposite 的 USE 标记。接着,你需要在 /etc/X11/xorg.conf 中加入以下片断来打开混色开关:

这仅仅是 Xfce 和 Xorg-X11 所要求的最低限度配置。但是,对硬件加速渲染的设置则取决于系统的显卡,这已经超出本指南的范围。我们的WIKI有各种如何配置让各种显卡实现硬件加速渲染的方法。

当你配置完成一个漂亮的 Xfce 桌面后,下一步要做的是给它截个图,并分享给朋友们!只要安装 xfce-extra/xfce4-screenshooter 就可以了。然后你就可以把你的图片发出去让所有人羡慕啦。

升级

如果你正从 Xfce 的较早的主要版本(4.x)升级,那么你需要删除旧的缓存的 session 和配置文件,因为它们和新版本不兼容。运行下面的命令为你的每一个用户删除不兼容的缓存的 sessions 和配置文件:

root #rm -r ~/.cache/sessions
root #rm -r ~/.config/xfce*
root #rm -r ~/.config/Thunar

用户会看到一个新的漂亮的界面,但是会丢失一些自己的配置。遗憾的是,还没有配置文件迁移工具……

外部资源

对于配置和使用Xfce你还需要其它的帮助吗?还想得到更多轻量级应用程序的建议?试试到这里找找:

  • Gentoo论坛
  • Xfce提供的帮助文档和其它文档:安装在/usr/share/xfce4/doc/C/index.html。用你的浏览器打开这页开始阅读。甚至还有许多配置选项的细节“隐藏”在这些帮助文档里面。

This page is based on a document formerly found on our main website gentoo.org.
The following people contributed to the original document: nightmorph
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.