Table of Contents

常见问题

这里汇集了 Xfce 相关的常见问题。用不着客气,您可以改进和/或扩充此页面,但要让页面准确易读。

入门

关于 Xfce

“Xfce“ 是什么?我为什么要使用它?

Xfce 是在 Unix 和其它类 Unix 平台 (比如 Linux、Solaris 或 BSD) 上运行的桌面环境。Xfce 是 “为适用性而设计。虽然它在载入或执行应用程序时很快,但仍然节省系统资源。”(Oliver Fourdan)。正在寻找轻便时尚又快速高效的桌面环境?到了这儿,您应该已经坚信,Xfce 是您的不二之选!

Xfce 怎么读?它是什么意思?

按顺序念出字母即可。Xfce 这个名字起初表示 XForms Common Environment,之后,Xfce 重写了两次,现在已不再使用任何 XForms 工具。名称留了下来,但 F 已不再大写。如今首字母 X 不表示任何东西 (建议:X Freakin' Cool Environment)。

标志符象征什么?

象征小巧玲珑、机敏伶俐的小精灵等等。您自己琢磨吧。

Xfce 可以在哪些平台上运行?

Xfce 本着灵活、可移植性的理念开发。支持 Linux、Solaris 和 BSD,甚至可以为 IRIX、MacOS X 和 Windows 量身打造。

Xfce 以何种许可协议发布?

Xfce 4 组件以自由或开源的许可协议发布:应用程序以 GPL 或 BSDL,库文件以 LGPL 或 BSDL。查阅相关文档、源代码或浏览 Xfce 主页] 获取详情。

有固定的发布周期吗?

没有固定的时间表,但有开发者要尽量实现的目标。因为设定期限无益于那些需要额外加时的工作。所以是在特定的整体目标实现后就发布新版本。您可以浏览 http://www.xfce.org 及其子页了解项目的最新进展情况。

安装

Xfce 至少有两种安装方式:

登录 Xfce 桌面

可以从控制台中登录 Xfce 吗?

有三种方式:

if [ "$(tty)" = "/dev/tty1" -o "$(tty)" = "/dev/vc/1" ] ; then
  startxfce4
fi

可以使用显示管理器登录 Xfce 吗?

当然可以。这或许是您所用发行版的默认方式。

设置 LXDM

LXDM 是 LXDE 的显示管理器,但也用于其他版本。笔者认为它是适用于 Xfce 的一个优秀的管理器:不依赖 GNOME 或 KDE,漂亮的界面,非常完美。大多数发行版有其安装包。配置它,需要检查文件 /usr/share/xsessions/06xfce4.desktop 是否存在(不存在的话请添加)(不同的发行版,可能位置不通),文件内容应像这样:

[Desktop Entry]
Encoding=UTF-8
Name=Xfce4
Comment=Use this session to run Xfce4 as your desktop environment
TryExec=/usr/bin/startxfce4
Exec=/usr/bin/startxfce4
Icon=/usr/local/share/pixmaps/xfce4_xicon1.png
Type=Application

TryExec 和 Exec 行在不同发行版本可能不同。

使用 Slim

如果想要不依赖 Gnome 或 KDE,又想要比 XDM 更具有吸引力的话,您可以试试 Slim,它是不依赖于任何桌面环境的 X11 登录管理器。阅读 Slim 的 手册 获取详情。

Setting up GDM

If you installed Xfce system-wide and you want to use the GNOME Display Manager (gdm) to start your Xfce session, you will have to create a .desktop file to teach gdm how to start the Xfce session. This is a sample desktop file, Xfce.desktop: 如果您安装了 Xfce 然后想使用 GNOME 显示管理器 (gdm) 来开始您的 Xfce 会话,你需要创建一个 .desktop 文件来告诉 gdm 如何开始 Xfce 会话。这里有一个示例文件, Xfce.desktop :

  [Desktop Entry]
  Encoding=UTF-8
  Name=Xfce4
  Comment=Use this session to run Xfce 4.4 as your desktop environment
  Exec=/usr/local/bin/startxfce4
  Icon=/usr/local/share/pixmaps/xfce4_xicon1.png
  Type=Application

通常情况下,您只需通过简单复制此示例文件至 gdm 使用的会话目录里即可;此目录通常位于 /etc/dm/Sessions, /etc/X11/gdm/Sessions, /usr/share/xsessions, /usr/X11/share/gnome/xsessions 或者一些其他位置,您可以阅读您的系统文档了解它。当你创建此文件后,请重启 gdm 使之生效。

设置 KDM

如果您安装了 Xfce 然后想使用 KDE 显示管理器 (kdm) 来开始您的 Xfce 会话,你需要创建一个 .desktop 文件来告诉 kdm 如何开始 Xfce 会话。 首先您需要查找 kdm 的 .desktop 文件位置:

  locate kde.desktop

它通常位于 /usr/share/apps/kdm/sessions 或 /usr/local/share/kdm/sessions。一旦您找到 kdm 会话目录,您需要创建一个新文件 Xfce.desktop :

  [Desktop Entry]
  Encoding=UTF-8
  Type=XSession
  Exec=/usr/local/bin/startxfce4
  TryExec=/usr/local/bin/startxfce4
  Name=Xfce4
  Comment=The Xfce4 Desktop Environment

登录问题

Xfce 认为您的主机名在 /etc/hosts 里面,比如:127.0.0.1 localhost

注销问题

由于某些原因,您的 X 应用程序未能与会话管理器连接。可能的原因有:您的主机名出了问题 (参看登录问题),您的 /home 分区或 /tmp 分区已爆满,您的主机名包含非 ascii 字符, ~/.ICEauthority 或 /tmp/.ICE-unix 权限设置有误。还可以检查 .xsession-errors 寻找线索。

用法

键盘

xfce中调用菜单有什么快捷键吗?

在键盘首选项里指派一个键 → 命令xfdesktop -menu的快捷方式。当鼠标被定位是菜单就会显示出来。你也可以使用xfce4-popup-menu来弹出面板菜单(该功能同样是由xfdesktop提供的,请确保你的面板装有相应的插件^_~)。

可以使用一个键来聚焦Verve插件吗?

给命令verve-focus分配一个键

我的windows键不能用键盘首选项Keyboard Settings > 快捷键。

那个windows键(又叫super键)之所以不能当作修饰键使用与Xfce使用的工具包GTK+有关。如果你希望windows键工作的话,我们建议你将GTK+至少升级到版本2.10.0。

如何在登录是开启numlock键?

有两种方法可以实现。使用能够开启numlock的display manager(eg. gdm,检查设置),或使用一个叫numlockx的小程序,在.xinitrc中加入numlockx on就行了。

可以在Shortcut Editor中使用Media keys吗?

用xmodmap来给你的Media keys指派keycodes以使它们能被Xfce shortcut editor所用:

使用程序xev来决定multimedia keys的keycodes。在你的主目录创建一个包含那些keycodes.Xmodmap文件,并给他们分配keysyms。例如:

 keycode 162 = XF86AudioPlay
 keycode 164 = XF86AudioStop
 keycode 160 = XF86AudioMute
 keycode 144 = XF86AudioPrev
 keycode 153 = XF86AudioNext
 keycode 176 = XF86AudioRaiseVolume
 keycode 174 = XF86AudioLowerVolume

所有可能的keysyms可以在 /usr/lib/X11/XKeysymDB 或 /usr/share/X11/XKyesymDB中找到。为确保在你启动Xfce时.Xmodmap被加载,在你的.xinitrc.xprofile文件中加入/usr/bin/xmodmap $HOME/.Xmodmap。当你启动shortcut editor,按下一个多媒体键时,那些被指派的keysyms应该会出现的。现在可以给他们指派命令了。 Note: Several problems with auto-loading of .Xmodmap files at xfce startup have been reported (also when issued as autostart command). Search the xfce bugzilla sites for current problems. As a workaround, run xmodmap ~/.Xmodmap by hand every time, or try out editing the somewhat less straightforward xkb configuration files.

How to determine keycodes with ''xev''

All keyboards are different, keycodes can differ(eg. my keyboard with few keycodes above, not working) and of course not everyone has time to search XKeysymDB file. You can acquire keycodes from your keyboard with xev. In terminal type:

  xev | grep -A2 --line-buffered '^KeyRelease' | sed -n '/keycode /s/^.*keycode \([0-9]*\).* (.*, \(.*\)).*$/\1 \2/p'

then press key of which keycode you need, eg. I press “Stop” and got output “174 XF86AudioStop”.

我想改变键盘布局怎么办?

There are several options. One is to use xfce4-xkb-plugin, see http://goodies.xfce.org/projects/panel-plugins/xfce4-xkb-plugin . You can also use the setxkbmap command with the two letter keyboard code as argument; you can edit your X server configuration file to choose a different keyboard layout (change the value after Option “XkbLayout”, e.g.: Option “XkbLayout” “dvorak”).

Is it possible to change the default shortcut keys?

Yes, of course… Keyboard shortcuts are defined on two locations. The shortcuts to handle the window manager are defined in the Settings Manager > Window Manager Settings > Keyboard. The Default theme can not be changed, but when you add a theme you can change that one. More global keyboard shortcuts, like volume adjustements, can be found in Settings Manager > Keyboard Preferences > Shortcuts. Again you need to add a new theme before you can start customizing it.

How can I see a list of all the shortcut keys?

Use the following command, which will produce a nicely formatted text list to standard output:

xfconf-query -c xfce4-keyboard-shortcuts -l -v | cut -d'/' -f4 | awk '{printf "%30s", $2; print "\t" $1}' | sort | uniq

If you want to put this list into a file, add > filename at the end of command.

How do I make a shortcut that doesn't steal focus?

You can't.

Ok, why were the default shortcuts suddenly changed in 4.6?

How do I enable menu accelerators?

Menu accelerators let you set a keyboard shortcut to a menu item or entry. To enable menu accelerators go to the main menu and select:

Settings → Appearance → Settings tab

and select the 'Enable Editable Accelerators' option.

Alternatively you can run the command xfce4-appearance-settings from a terminal or from the Alt-F2 run command instead of using the menu to get to the appearance settings to enable accelerators.

Kiosk

我在公共环境下使用Xfce,我不希望用户更改他们的菜单。

用kiosk模式(参见xfce4-sessionpanel docs).

菜单

左击菜单按纽显示菜单似乎有些慢。我如何改变它?

左键单击显示菜单的速度是指向双击速度的一个链接。如果你想让菜单显示得快点的话,只要在Xfce 4 Settings Manager的鼠标首选项里将双击速度改快点就行了。或者,你可以右击来得到菜单,那个菜单是一点就出来的。

如何显示窗口列表?

两种方法。鼠标中键(如果xfdesktop在运行的话),或在面板中加入窗口列表插件(is provided with a xfce4-popup-windowlist command)。

如何使用menu editor更改自动生成的菜单?

cp ~/.cache/xfce4/desktop/menu-cache-name-of-the-generated-file.xml ~/.config/xfce4/desktop/menu2.xml
cd ~/.config/xfce4/desktop/
cat menu.xml > menu3.xml
cat menu2.xml >> menu3.xml
mv menu.xml menu.orig.xml
mv menu3.xml menu.xml

现在,你已经有了一个包含所有类别的菜单了,其中会有些重复,首先你得使用你最喜欢的编辑器编辑menu.xml文件,去处文件中间的如下几行,不然menu editor会抱怨格式错误的:

</xfdesktop-menu>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xfdesktop-menu>

<xfdesktop-menu>

这样就行了。现在你可以运行menu editor来更改菜单了。

Settings > Desktop > Menu > Menu Editor

注意:通过删除“system”行,你会删除所有重复菜单项。所以,如果自动生成的菜单中改了的话,它们不会再出现,但你得手动去掉大部分重复项。

要恢复原来的菜单,在终端中执行:

mv menu.xml menu3.xml; mv menu.orig.xml menu.xml

What are the exact commands used when launching the 'Setting' applications?

Please see this wiki entry.

文件管理器

You can find more information about Thunar in the Docs section.

我可以禁用回收站吗?

不,你不行。 But you can do for example:

  1. use 'SHIFT + del' to bypass the trash bin and immediately delete something for real.
  2. use cron to clean the trash every now and then.
  3. or create custom action for permanent delete(like in gnome) with action: rm %f then in context menu you'll have button “permanent delete”

我想为菜单中的”什么什么“在Thunar中分配一个快捷键

Thunar允许你通过简单的将鼠标至于选项之上,再按下快捷键的方式来编辑菜单加速器。 要起用这项功能请在User Interface Settings plugin中选中“可编辑菜单加速器”选项。

那些移动到回收站的东西都跑到那去了?

Thunar遵循freedesktop规范。通过以下链接你可以找出更多的关于这项规范的说明。请参阅这里 以及 这里.

你会在~/.local/share/Trash/files找到你删除的项目

Thunar可以显示视频缩略图吗?

两种可行方案。你得为thunar编译gconf (GNOME thumbnailers)支持,并安装一种GNOME电影预览程序,例如包含totem-video-thumbnailer的Totem。 Second, You can get thumbnails without GNOME by installing thunar-thumbnailers plugin.

When will it support samba/network browsing?

Thunar has had the ability to browse remote network shares (such as Samba and FTP) since Xfce 4.8/Thunar 1.2.

桌面管理器

我想在桌面上禁用回收站图标、主目录图标和文件系统图标,行吗?

可以,在设置-桌面-图标下面默认图标前面去掉勾即可。

我的Xfce桌面没有任何快捷方式,为什么?

可以,在设置-桌面-图标下面默认图标前面勾选您想要的图标即可。

窗口管理器

Firefox jumps between workspaces, why?

When a new tab is opened from an external link in Firefox, it asks the WM to show the window containing the new tab. If the window that has requested to be raised is not on the current desktop, the Xfce Window manager will bring it to the current desktop by default. If you do not want this behavior, there is a hidden option to control this behavior. For Xfce 4.4 in ~/.config/xfce4/xfwm4/xfwm4rc you can put the following:

  activate_action=bring|switch|none

For Xfce 4.6 and 4.8 you can go to Xfce Menu > Settings > Window Manager Tweaks and go to the tab Focus, or you need to use the xfconf-query tool to change the setting:

  xfconf-query -c xfwm4 -p /general/activate_action -s bring|switch|none

As the name suggests, the “bring” option moves the window requesting to be raised to the current workspace, the “switch” option switches workspaces, and the “none” option takes no action.

The above command edits the file “~/.config/xfce4/xfconf/xfce-perchannel-xml/xfwm4.xml” by adding or modifying this line: “ <property name=“activate_action” type=“string” value=“switch”/> ”

许多窗口经常居中,为什么?

Xfce窗口管理器有个智能放置特性,可以根据窗口大小进行调整。基本上它会自动将小于一定大小的窗口居中,当有个更大的窗口时,它会被安排到一个最适合的位置。你可以在Settings → Window Manager Tweaks → Placement中更改最小窗口设置。

可以让窗口记住他们的位置吗?

简单的回答:不行。 长的回答:如果程序支持这种功能,那么它会记住上次的位置以及大小。如果不支持,你可以使用一个窗口匹配程序如devilspiewmctrl

How do I programmatically switch workspaces, move windows, etc?

wmctrl is a commandline tool that can switch workspaces, move windows between workspaces, move window positions, maximize windows, etc.

libwnck is a library that does similar things.

A window suddenly became transparent! How do I undo this?

If display compositing is enabled, the Xfce Window Manager allows you to adjust the opacity of a window by hovering your mouse over the title bar, holding down the Alt key, and using the scroll wheel (down lowers the opacity, and up raises it). So use Alt+ScrollWheelUp to reset the transparency.

I have only one desktop and can't move my windows anymore! HELP!

If you have no window borders anymore and can't focus windows, xfwm4 probably closed itself. This happens sometimes and due to the random nature of this annoying bug it's hard to track. But there are workarounds available.

Start xfwm4 again

Sounds like the simpliest solution. You need a terminal and a command executioner (like xfrun4 (alt + f2)) with focus. In the terminal you enter following command:

xfwm4 --sm-client-id=${SESSION_MANAGER##*/} & disown

And you're done, xfwm4 should be now in your session again. If this doesn't work, stick with method 2 or 3 below.

The easy solution for every xfce (not for people loving their sessions)

Because xfwm4 goes fishy most times at start up it isn't bad if you have to log out. You hadn't done anything important until than. So log out, remove ~/.cache/sessions/* (probably with

rm -rf ~/.cache/sessions/*

and login back again. Don't do this while you're logged in to xfce! Don't do this if you love the xfce session feature (because you delete all sessions, duh)!

The cool new xfce4.10 solution (again, not for people loving their sessions)

If you already use xfce4.10 you have the possibility to use the GUI to delete the sessions cache (as you can see, the devs are annoyed, too). Open xfce4-sessions-settings → Session and click »Clear saved sessions«, than log out and in again. This should be all.

会话管理器

有些程序总是会自启动

有两种可能:上次保存的会话,或它在自启动列表里面。用以下两种方法之一去处自启动程序。

我无法关机或重启

有两种方法解决这个问题:sudo and hal/dbus. Default starting from version 4.4 is hal.

使用 sudo

你必须允许普通用户使用执行<prefix>/libexec/xfsm-shutdown-helper<prefix>/libexec/ may be changed on your distribution, i.e. /usr/lib/xfce4/session/。安装sudo并运行visudo (root) 并增加一行(将prefix用正确的路径替换):

 %users ALL = NOPASSWD:<prefix>/libexec/xfsm-shutdown-helper

将用户加入超级用户组(root):

 gpasswd -a <username> users
 

Add the user to the power group:

 gpasswd -a <username> power

当你注销后再登录时,关机和重启应该就可以用了。你可以参阅xfce4-session和sudo的文档以获取更多信息。

使用 hal 和 dbus

请确保hal和dbus进程在系统启动时已经启动,and that you are running a recent version of dbus (at least 1.1).具体步骤各发行版有所不同,请参考您所用的发行版的文档。

你的 /etc/dbus-1/system.d/hal.conf 文件应当包含这段文字:

 <policy group="power">
  <allow send_interface="org.freedesktop.Hal.Device.SystemPowerManagement"/>
  ...
</policy>

把用户加入超级用户组 (root):

 gpasswd -a <username> power

当你注销后再登录,你的关机重启按钮就会变得灵敏。

当我按退出时看不到注销对话框

在会话和启动中选中注销时提示

面板

如何在Xfce 4.2中禁用任务条?

别在开始时运行就行了……

"使用启动提示"选项是干嘛的?

如果你选中此项,在程序加载时窗口管理器将会显示一个沙漏。需要安装有startup-notification libraries。该特性只支持现代应用程序(Gtk2.x and Qt3.x based)。

Please note that the API is not yet frozen, and therefore Xfce 4 is only guaranteed to work with the startup-notification library version >= 0.5.

外观

应用程序

求助,我的面板/任务拦/桌面/窗口边框不见了

由于Xfce是模块化的,所以所有的元素都有独立的进程。你只需重启那些进程即可。如果你想确认他们会在下次登录是自行启动的话,检查注销对话框中的“为下次登录保存会话”选项有无选中。

Panel xfce4-panel
Taskbar xftaskbar4 (Xfce 4.2 only)
Window Manager xfwm4
Desktop xfdesktop (can depend on the dbus service, Xfce 4.4 only)
Desktop menus xfdesktop

我的桌面这样漂亮, 我想做个截屏!在Xfce里怎么做呢?

这有至少6种可用的方法:

    • Add it to your panel and click to make a screenshot, or use the xfce4-screenshooter stand-alone application.
    • Dedicated application for doing screenshots and application captures
    • Add a keyboard shortcut (i.e. Control-Printscreen) for the “salasaga_screencapture” command
  1. 使用Gimp
    • e.g. “scrot -s -t 150×150” (用鼠标选择一个窗口或按住左键在屏幕上拖出一个矩形)
  2. 从ImageMagick导入
    • e.g. “import image.png” (用鼠标选择一个窗口)
  3. Using good old xv with grab function

The file chooser is very slow, what is it?

It is more likely that the icon theme you are using renders too many SVGs making it very hard to scroll. Switch to another icon theme.

Response to Terminal application is slow?

For NVidia users, add this to your settings:

nvidia-settings -a InitialPixmapPlacement=0 -a GlyphCache=1

For all users, your driver may not support argb visuals very well. You can disable it for Terminal by exporting the environment variable XLIB_SKIP_ARGB_VISUALS=1. To disable it for Terminal only, put the next lines inside ~/bin/Terminal for example (given you have a personal bin directory, you can also put it inside /usr/local/bin):

#!/bin/sh
XLIB_SKIP_ARGB_VISUALS=1 /usr/bin/Terminal

主题

gtk-xfce-engine主题没出现在"user interface"设置对话框中

gtk-xfce-engine-2必须与Gtk2装在同一目录中。当从源代码安装时,默认是安装在/usr/local的,但Gtk2经常安装在/usr。用./configure –prefix=/usr将它安装在/usr,这样主题应该就可用了。

如何定制我的Xfce桌面环境

你可以阅读安装新主题关于改变主题的所有内容。

窗口管理器

如何使面板透明以及窗口阴影?

在X11中开启混合扩展,确保你的Xfwm4编译了混合支持(xfwm4 -V)。

 Section "Extensions"
   Option "Composite" "Enable"
 EndSection

Pay attention: recent versions of X.org turn composite on by default. If you experience speed problems or any other glitches you have to disable it explicitly:

 Section "Extensions"
   Option "Composite" "Disable"
 EndSection

If you have a reasonably new X.org (7.1, possibly 7.0) and your graphics card is listed as “supported” at X.org's EXA status page, you should also enable EXA by adding this line to the card's Device section in your xorg.conf:

   Option "AccelMethod" "exa"

Enabling EXA will normally provide a speed increase for compositing and font rendering, but may cause a small reduction in OpenGL rendering speed.

Once the Composite extension is activated, go to Settings → Panel and Settings → Window Manager Tweaks.

ATI users (X.org radeon driver)

ATI R3xx/R4xx (9500 to X850, X1050) users may also need this in the device section for the card:

 Option "MigrationHeuristic" "greedy"
 Option "AccelDFS" "true"			# but see radeon(4)
 Option "EnablePageFlip" "true"
 Option "EnableDepthMoves" "true"
nVidia users

NVidia用户需要(这是推荐的)在device部分加入:

 Option "RenderAccel" "true"
 Option "AllowGLXWithComposite" "true"

Read /usr/share/doc/nvidia-glx/README.txt.gz (and search for “RenderAccel” and “AllowGLXWithComposite”) to see if they are recommended at all for your system. At least for recent NVidia GLX drivers, “AllowGLXWithComposite” “true” is only for X servers older than X11R6.9.0, and “RenderAccel” “true” is the default setting, and therefore not required. If you are running a recent NVidia driver and a recent xorg-server, you do not need these settings (and should not use the “AllowGLXWithComposite” “true” setting).

面板

可以给图标盒或任务栏中的应用程序更改图标吗?

这不可能。这是应用程序自己的事。

我安装了一个面板插件,但指示器不使用多种颜色。我该怎么办?

首先,试试其他Gtk主题,因为某些主题覆盖了颜色。如果不解决问题,你很可能有个旧的~/.gtkrc-2.0:删了它再试一下。

如何在Xfce 4.2和4.4设置面板的层?

为了改进聚焦管理,该选项被移除。

Is there a world clock applet?

You need to add the Orage Clock to the panel. Then you can middle-click the clock to open the “Global Time” window, to which you can add any number of clocks.

开发

如何报告bugs?

你可以在此报告bugs或在邮件列表论坛上寻求帮助。如果你要报告bug,请阅读Xfce debug guidePidgin get a backtrace 以确定你的bug report真的有意义。

新版本发布周期是多少?

什么时候我们觉得可以发布了我们就发布。如果你对此不高兴,你可以雇佣整个Xfce开发团队并且付我们工钱(we accept VISA/MasterCard, but not American Express)……这样我们甚至可以为你量体裁衣……

I have asked a question / reported a bug on the mailing list / bugs.xfce.org and no one is answering

2 possibilities: