This is Gentoo's testing wiki. It is a non-operational environment and its textual content is outdated.

Please visit our production wiki at https://wiki.gentoo.org

Xfce

From Gentoo Wiki (test)
Jump to:navigation Jump to:search
This page is a translated version of the page Xfce and the translation is 89% complete.

引用 xfce.org网站的话:“Xfce 是类Unix操作系统上的 轻量级 桌面环境 。 虽然它致力于快速与低资源消耗,但仍然具有视觉吸引力且易于使用。”

安装

避免不必要的依赖

避免可选的GNOME支持和包将使系统更加精简,这部分完全是可选的:如果目标是使系统保持较小而不是较大,则以这种方式进行。

确保系统使用基本的“desktop” profile配置文件:

root #eselect profile set default/linux/amd64/17.0/desktop

app-text/poppler 默认具有 +qt5

FILE /etc/portage/package.use/xfce取消设置poppler的qt5 USE标记
app-text/poppler -qt5

当然,如果需要, -qt5 也可以在 /etc/portage/make.conf 中全局设置。

设置 XFCE_PLUGINS

/etc/portage/make.conf中,添加并自定义 XFCE_PLUGINS 变量:

FILE /etc/portage/make.conf设置 XFCE_PLUGINS
XFCE_PLUGINS="clock power trash"

以上选项可能会改变;当前列表可以在 ${PORTDIR}/profiles/desc/xfce_plugins.desc中找到。

安装(Emerge)

是时候安装完整的Xfce桌面了!

如果没有在 emerge 命令中明确包含 xfce-extra/xfce4-notifyd ,则 virtual/notification-daemon 将在GNOME的 x11-misc/notification-daemon 中进行绘制。因此,将它与 xfce-base/xfce4-meta 一起安装,然后取消选择它,使其不包含在world文件中:

root #emerge --ask xfce-base/xfce4-meta xfce-extra/xfce4-notifyd
root #emerge --ask --deselect=y xfce-extra/xfce4-notifyd

当然,也可以只选择所需的包:

root #emerge --ask xfce-base/xfwm4 xfce-base/xfce4-panel

配置

显示管理器

可以使用显示管理器启动Xfce,请参阅display manager中相关文章以配置显示管理器。

大多数显示管理器使用

  • .desktop 文件来配置可用会话,以下是一个示例桌面文件:
FILE xfce4.desktop用于显示管理器的Xfce4 desktop 文件
[Desktop Entry]
Encoding=UTF-8
Name=Xfce4
Comment=Use this session to run Xfce 4 as desktop environment
Exec=/usr/bin/startxfce4
Icon=/usr/share/pixmaps/xfce4_xicon1.png
Type=Application

desktop文件可以放置在显示管理器的正确位置。

在没有显示管理器的情况下启动Xfce

startxstartxfce4 是在不使用显示管理器情况下启动Xfce的两种现成的方案

startx

使用 startx 时,使用以下内容创建 ~/.xinitrc 文件:

FILE ~/.xinitrc调用startx时启动xfce4
exec startxfce4

在OpenRC配置文件中遇到xfce4内的授权或权限问题时(现象包括无法打开电源管理器且无法睡眠或休眠),请确保 sys-auth/consolekit 软件包已使用了 pm-utils USE标志。然后替换 ~/.xinitrc 中刚刚那行内容为以下内容(有关更多信息,请参阅Gentoo论坛):

FILE ~/.xinitrc在调用startx时以正确的方式启动xfce4
ck-launch-session dbus-launch --sh-syntax --exit-with-session xfce4-session

startxfce4

要启动Xfce4桌面,只需在命令行键入startxfce4,然后按回车键:

user $startxfce4

Xfce是一个桌面环境,因此可以根据几乎每个用户的需求进行调整和定制。在本节中,涵盖了许多受欢迎,或更具挑战性的内容。

音量按键

xfce4-volumed

安装xfce-extra/xfce4-volumed来管理音量键(不建议使用,建议使用media-sound/tudor-volumed替代,或在Window Manager或混音器中使用键绑定):

root #emerge --ask xfce-extra/xfce4-volumed

将pulseaudio与xfce4一起使用时,请使用xfce-extra/xfce4-volumed-pulse

root #emerge --ask xfce-extra/xfce4-volumed-pulse

键盘快捷键

运行xfce4-keyboard-settings来绑定以下键:

  • volume up 按钮: amixer总音量增加5%
  • volume down 按钮: amixer总音量减少5%
  • mute 按钮: amixer静音切换

GTK+ 3 主题

原生Xfce主题引擎

Xfce自己的主题引擎x11-themes/gtk-engines-xfce在3.0版本中进行了更新,该版本实现了对GTK+ 3的原生支持,无需进一步配置。

假设设置了gtk3 USE标志,使用--deep为world升级时,如果xfce-base/xfce4-metax11-themes/gtk-engines-xfce随升级一起安装,则会默认安装GTK+ 3版本(修订版本号为300或更高)。

如果没有:

root #emerge --ask x11-themes/gtk-engines-xfce

这应该通过使用特定的SLOT引入正确版本的x11-themes/gtk-engines-xfce

在安装GTK+ 3版本的x11-themes/gtk-engines-xfce之后,当使用其中一个原生Xfce主题时,使用GTK+ 3的应用程序现在应该与使用GTK+ 2的应用程序很好地融合。

Greybird主题

另一种选择是使用Greybird主题,它支持GTK+ 2,GTK+ 3,xfwm4,emerald和metacity:

root #emerge --ask x11-themes/greybird

转到Xfce菜单 -> 设置 ->外观,或者运行xfce4-appearance-settings,从“样式”列表中选择“Greybird”。

现在GTK+ 2和GTK+ 3应用程序应具有一致的外观。

其他主题

可以使用下表安装Portage中可用的与XFCE兼容的其他主题:

root #emerge --ask x11-themes/clearlooks-phenix x11-themes/gnome-themes-standard x11-themes/gtk-engines-aurora x11-themes/light-themes x11-themes/murrine-themes x11-themes/nimbus x11-themes/oxygen-molecule x11-themes/redhat-artwork x11-themes/shiki-colors x11-themes/tactile3 x11-themes/zukini

附加程序

Xfce中还有许多的附加程序

Package Description
x11-terms/xfce4-terminal 适用于Xfce的流行终端仿真器; 优于标准的xterm程序。
xfce-base/xfce4-appfinder 应用程序查找器。
xfce-base/thunar Xfce的文件管理器。
xfce-extra/xfce4-mixer 音量控制。 (已弃用并从Gentoo中删除 - Pulseaudio用户可以安装xfce-extra/xfce4-pulseaudio-plugin。其他人可以安装media-sound/volumeicon或类似的托盘音频混音器)
xfce-extra/thunar-volman 管理可移动媒介和驱动器。
xfce-extra/tumbler Thunar的文件预览器。
xfce-extra/thunar-archive-plugin Thunar的压缩包扩展插件;使用 app-arch/file-roller
xfce-extra/xfce4-battery-plugin 显示电池百分比,剩余时间,电源方式(交流电或电池),风扇状态,警告信息,甚至可配置为执行某些功率级别的命令,可在电池电量耗尽时将笔记本电脑置于休眠模式。
xfce-extra/xfce4-verve-plugin 嵌入面板的小命令行; 比打开另一个终端运行命令更快。
xfce-extra/xfce4-mount-plugin 一键挂载/etc/fstab中列出的设备。
xfce-extra/xfce4-sensors-plugin 监视硬件传感器,例如CPU温度,风扇RPM,硬盘驱动器温度,主板电压等。
x11-themes/xfwm4-themes 几个窗口管理器主题。
xfce-extra/xfce4-power-manager 用于监视和管理电源使用情况的应用程序(对笔记本电脑尤为重要)。选择最高性能或省电模式。调整屏幕亮度并设置休眠,睡眠和关闭操作(即,关闭盖子或按下按钮时)。可以在电池达到一定时发出警告,甚至可以关闭机器。使用面板插件显示电池状态、充电状态和控制屏幕亮度。

以下应用程序在Xfce中运行良好,并实现了基本的桌面环境。

描述
app-editors/mousepad 轻量级文本编辑器。
app-cdr/xfburn CD刻录应用程序。
x11-misc/alacarte GNOME的菜单编辑器在Xfce中正常可用。
x11-terms/tilda 轻型下拉式终端模拟器。
app-office/orage 简单的日历小程序。

故障排除

启用垂直窗口吸附

大多数现代桌面环境默认启用垂直窗口吸附,这在Xfce中也是可能的,但默认情况下并没有启用。要启用,请导航至:设置窗口管理器高级 选项卡

  • 确保已选中“将窗口吸附到屏幕边缘”复选框。
  • 确保未选中“光标碰到屏幕边缘时回绕工作区”下的复选框。这些干扰垂直窗口吸附。

一旦设置了复选框,现在应该可以将窗口拖动到屏幕的右侧或左侧,这会导致窗口调整为屏幕宽度的50%。

如果想通过快捷键 Super+Super+ 来操作窗口,在设置窗口管理器键盘 标签页.

设置“窗口平铺在左”为Super+组合键,设置“窗口平铺在右”为组合键Super+

Audio mixer complains about missing pavucontrol binary

Clicking the speaker (audio) icon in the panel and then selecting Audio mixer... results in a message saying "pavucontrol binary not found".

The solution is to install media-sound/pavucontrol:

root #emerge --ask media-sound/pavucontrol

Program starting hotkeys are not working / Colors not changeable from appearance

Xfce can have hotkeys for both starting an application as well as modifying the behavior of an already running application or setting. An example of behavior hotkey is the Ctrl+Alt+D combination, which minimizes all windows to show the deskop (and vice-versa).

Assuming that hotkeys for starting an application (such as Alt+F2 to start the application finder) are not working, while the application can be started from the menu, then Consolekit is not running. Start it, and make sure that it gets started at boot time:

root #/etc/init.d/consolekit start
root #rc-update add consolekit default

This will also start D-Bus, a prerequisite for Consolekit. Restart X to enjoy the new hotkeys and colors.

另请参阅

  • Xfce 指南 - 更详细的安装配置指南,阅读该以获取更多Gentoo详细内容!