Xfce

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

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

Selecting a profile

重要
Read relevant documentation before performing any profile changes.

Using the basic desktop profile will provide a good set of defaults for Xfce. Other profiles can be used, but this gives a good balance between dependencies and usability, all else aside. To select the desktop profile:

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

避免不必要的依赖

app-text/poppler 默认具有 +qt5

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

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

xfce4-notifyd

This is an optional step to install xfce-extra/xfce4-notifyd in place of x11-misc/notification-daemon. Skip this section if the choice of notification daemon is unimportant.

Emerging xfce-base/xfce4-meta will pull in the virtual/notification-daemon dependency. This virtual dependency is designed to insure that Xfce will be provided with a notification-daemon, whatever suitable software the user chooses to fulfill this role.

By default, virtual/notification-daemon will satisfy this dependency by drawing in GNOME's x11-misc/notification-daemon package. Xfce users may prefer to use xfce-extra/xfce4-notifyd, if a notification-daemon has not already been installed.

By installing xfce-extra/xfce4-notifyd before emerging Xfce, the virtual package virtual/notification-daemon will use xfce4-notifyd, and pull in no other packages. Use the --oneshot option to avoid adding xfce4-notifyd to the world file:

root #emerge --ask --oneshot xfce-extra/xfce4-notifyd

Now proceed with the installation.

安装

USE flags

USE flags for xfce-base/xfce4-meta The Xfce Desktop Environment (meta package)

minimal Install a very minimal build (disables, for example, plugins, fonts, most drivers, non-critical features)
pulseaudio Add support for PulseAudio sound server
svg Add support for SVG (Scalable Vector Graphics)
upower Enable power management support

安装(Emerge)

Emerge xfce-base/xfce4-meta for a default set of Xfce packages, to get a reasonably complete desktop environment:

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


The xfce-base/xfce4-meta package will provide the following user-facing applications, plus some libraries and system software:

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 用于监视和管理电源使用情况的应用程序(对笔记本电脑尤为重要)。选择最高性能或省电模式。调整屏幕亮度并设置休眠,睡眠和关闭操作(即,关闭盖子或按下按钮时)。可以在电池达到一定时发出警告,甚至可以关闭机器。使用面板插件显示电池状态、充电状态和控制屏幕亮度。

To see everything that is installed by xfce-base/xfce4-meta, see the dependency tab for that package on pgo.

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

附加程序

Xfce中还有许多的附加程序

Package Description
app-cdr/xfburn CD burning application.
app-editors/mousepad Lightweight text editor.
x11-themes/xfwm4-themes Several window-manager themes.
xfce-extra/thunar-archive-plugin Plugin for Thunar to work with archives; uses app-arch/file-roller.
xfce-extra/xfce4-battery-plugin 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, which can be used to put the laptop into hibernate mode when the battery is almost exhausted.
xfce-extra/xfce4-mount-plugin One-click mounting of devices listed in /etc/fstab.
xfce-extra/xfce4-sensors-plugin Monitor hardware sensors, such as CPU temperature, fan RPM, hard drive temp, motherboard voltage, and more.
xfce-extra/xfce4-verve-plugin A small command line embedded into the panel; quicker than opening up another terminal to run a command.

This is just a partial selection of packages available in the Gentoo repository, see p.g.o/categories/xfce-extra, or use eix (eix --category xfce-extra), to see packages from the xfce-extra category. See also https://www.xfce.org/projects/ for more information.

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

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

Usage

Launching Xfce

Xfce can either be run from a terminal after login, launched automatically after login, or be started by a graphical display manager that will greet the user and ask for login details.

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

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

startx

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

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

If experiencing authorization or permissions issues, see the troubleshooting section.

startxfce4

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

user $startxfce4

显示管理器

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

大多数显示管理器使用

  • .desktop 文件来配置可用会话,以下是一个示例桌面文件:
文件 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是一个桌面环境,因此可以根据几乎每个用户的需求进行调整和定制。在本节中,涵盖了许多受欢迎,或更具挑战性的内容。

音量按键

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

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

media-sound/tudor-volumed may be an option for systems not using pulseaudio.

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

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

GTK+ 3 主题

另一种选择是使用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中也是可能的,但默认情况下并没有启用。要启用,请导航至:设置窗口管理器高级 选项卡

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

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

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

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

音频混音器提示缺少 pavucontrol 二进制文件

点击面板内的扬声器 (音频) 图标,然后在一条提示”pavucontrol binary not found“的消息中选择 Audio mixer... 这个路径。

解决方法是安装 media-sound/pavucontrol

root #emerge --ask media-sound/pavucontrol

Xfce4-screensaver unable to unlock

Xfce-screensaver uses gnome-keyring by default to authenticate. By applying the installation method above, gnome-keyring will not be pulled and pam will be unable to service the default configuration installed in /etc/pam.d/xfce4-screensaver. Either pull gnome-keyring, otherwise the file should be modified to allow system-auth to be used on passwords:

文件 /etc/pam.d/xfce4-screensaver
auth include system-auth
password include system-auth

Authorization or permissions issues

When experiencing authorization or permissions issues within xfce4 in an OpenRC profile (symptoms include being unable to open power manager and unable to suspend/hibernate) make sure that sys-auth/elogind is installed and properly configured, and that the elogind USE flag is globally enabled.

If launching with startx, replace the appropriate line in ~/.xinitrc with the following:

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

Dual-monitors get mirrored after monitor suspend

There are (at least) three ways to solve this issue. First is to save the display settings as the default monitor layout profile, then enable that profile as "new monitors connect". There's also the option to show a dialog whenever new monitors are detected, which will default to the profile instead of mirroring, when one is available. Navigate to Settings -> Display -> Advanced to find these options. Remember to configure the display settings before saving the first profile.

2nd way is to kill xfsettingsd after logging to the Xfce session. However this will also make some functionality unavailable, such as global hotkeys. A custom script can be created that kills the service, and add that to the autostarting applications list.

3rd is to have a custom script that can be executed via a .desktop icon on the desktop, panel, or ran manually each time the monitors are turned on.

Review the monitor IDs using the xrandr command.

The custom script could look something like the following:

文件 ~/bin/configuremonitors.shconfiguremonitors.sh
xrandr --output HDMI-A-0 --right-of DisplayPort-0 --auto

另请参阅

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