Difference between revisions of "Xfce (简体中文)"

From ArchWiki
Jump to: navigation, search
(常见问题与解答: Add troubles.)
m (Add translateme flag.)
Line 22: Line 22:
 
{{Article summary end}}
 
{{Article summary end}}
 
{{TranslationStatus (简体中文)|Xfce|2013-01-03|242786}}  
 
{{TranslationStatus (简体中文)|Xfce|2013-01-03|242786}}  
 +
{{Translateme (简体中文)}}
 
From [http://www.xfce.org/about/ Xfce - About]:
 
From [http://www.xfce.org/about/ Xfce - About]:
  

Revision as of 12:54, 3 January 2013

Template:Article summary start Template:Article summary text Template:Article summary text Template:Article summary heading Template:Article summary text Template:Article summary heading Template:Article summary wiki Template:Article summary wiki Template:Article summary wiki Template:Article summary end

翻译状态: 本文是英文页面 Xfce翻译,最后翻译时间:2013-01-03,点击这里可以查看翻译后英文页面的改动。

Tango-preferences-desktop-locale.png本页面需要更新翻译,内容可能已经与英文脱节。要贡献翻译,请访问简体中文翻译组Tango-preferences-desktop-locale.png

附注: please use the first argument of the template to provide more detailed indications.

From Xfce - About:

Xfce 是类 UNIX 操作系统上的轻量级桌面环境。虽然它致力于快速与低资源消耗,但仍然具有视觉吸引力且易于使用。Xfce 遵循 UNIX 的模块化和复用性哲学传统。它包含大量组件,有您期待的现代桌面环境所应具有的完整功能。它们分别打包,您可以从中挑选可用的软件包去创建理想的个人工作环境。Xfce 的另一个优点是遵循标准,特别是那些在 http://www.freedesktop.org 中定义的标准。Xfce 可以安装在若干 UNIX 平台上。已知可以在 Linux、NetBSD、FreeBSD、OpenBSD、Solaris、Cygwin、MacOS X 上和 x86、PPC、Sparc、Alpha... 上编译。

Contents

什么是XFCE?

类似于GNOME和KDE,XFCE是一个桌面环境。它包含一套应用程序,比如:根窗口程序、窗口管理器、文件管理器、面板,等等。XFCE用GTK2开发,同时,跟其它桌面环境一样,它也有自己的开发环境(库、守护进程等)。 不同于GNOME和KDE,XFCE是轻量级的,并且在设计上更接近CDE,而不是Windows或Mac。它的开发周期要长得多,但它非常稳定,速度极快。XFCE很适合在老一些的机器上使用。特性:

  • 相较于其他主流DE,它更轻量,占用更少的资源。
  • 几乎所有的设置都可以通过图形界面完成,xfce不会尝试向用户隐瞒任何东西。
  • Xfwm允许用户使用混合特性,可以体验“真透明“以及GPU加速等。
  • 它可以工作在多个监视器上。
  • Xfce4是个稳健、成熟的桌面套件。

安装方法

开始前,请确保已经安装配置了 X server

注意: Xfce 已经将所有的程序分组归类,可以选择性的安装。

基本 Xfce 系统可以通过 安装 位于 官方软件源 的软件包组 xfce4 获得。Pacman 会询问要安装的包,如果全部安装,只需要按 Template:Keypress。额外的软件包例如面板插件等位于 xfce4-goodies 组。

提示: 强烈建议安装 Gamin (FAM的继承者)。

运行XFCE

启动时自动运行

有两种方法在启动时自动运行 Xfce (以及实际上任何桌面或窗口管理器):

手动启动

注意: 保留登录会话的相关信息请参阅xinitrc

你只需要运行:

$ startxfce4

从终端启动,例如使用xinit/startx 需要配置Xinitrc (简体中文)

如果还没有~/.xinitrc 文件,系统里有一份实例文件供参考:

$ cp /etc/skel/.xinitrc ~/.xinitrc

在最后添加:

exec startxfce4

例如:

~/.xinitrc
#!/bin/sh

if [ -d /etc/X11/xinit/xinitrc.d ]; then
  for f in /etc/X11/xinit/xinitrc.d/*; do
    [ -x "$f" ] && . "$f"
  done
  unset f
fi

exec startxfce4
注意:
  • 如果你觉得奇怪,dbus-launch 会在文件开始被 xinitrc.d 代码引用。dbus-launch 会启动一个 dbus-daemon 线程来提供与 PolicyKit 的通信。
  • 正确启动 Xfce 的命令是 startxfce4: 不要直接启动 xfce4-session,因为它已经被 startxfce4 本身运行了。

在XFCE中关机、重启和自动挂载

参阅 General Troubleshooting#Session permissions.

如果使用 systemd,需要安装 systemd-sysvcompat 已正确重启和关闭系统。如果关机和重启没有问题,但是无法挂载外部磁盘,可能需要安装gvfs

提示和小技巧

Xfconf 设置

Xfconf 是 XFCE 系统中负责保存配置选项的组件。大部分 XFCE 都是通过 Xfconf 完成。修改这些设置有多种方式:

  • 最简单的方法是通过主菜单中的 "Settings",但是"Settings"没有包含所有选项
  • 不太方便的方法是
    Main menu -> Settings -> Settings Editor
    ,这里可以修改自定义选项,所有修改会立即生效。通过 xfce4-settings-editor 命令也可以启动设置编辑器。
  • 在命令行中通过程序 xfconf-query 可以进行完全设置。 XFCE 在线文档 提供了详细方法和示例,设置立即生效。
  • 设置保存在 XML 文件 ~/.config/xfce4/xfconf/xfce-perchannel-xml/ 中,可以手动修改这个文件,但是修改不会立即生效。
  • 更多信息请访问: Xfconf 文档

面板

如何自定义面板的背景

编辑~/.gtkrc-2.0。 图像文件得存放在~/中,不然面板不会正常显示。

 style "panel-background" {
   bg_pixmap[NORMAL]        = "foo.bar"
   bg_pixmap[PRELIGHT]      = "foo.bar"
   bg_pixmap[ACTIVE]        = "foo.bar"
   bg_pixmap[SELECTED]      = "foo.bar"
   bg_pixmap[INSENSITIVE]   = "foo.bar"
 }
 widget_class "*Panel*" style "panel-background"

替换Xfce默认的应用程序菜单

可以使用ubuntu的系统面板,利用Xfapplet将Gnome面板添加进Xfce。

参考这个the AUR

如何删除系统默认菜单

方法 1

在内建的菜单编辑器里,你并不能删掉系统默认的菜单按钮,这里有些隐藏他们的方法:

  1. 打开终端(Xfce开始菜单 > 系统 > Xfce终端)并且打开/usr/share/applications 文件夹:
    $ cd /usr/share/applications
  2. 这个文件夹应该都是.desktop文件。可以用
    $ ls
    命令查看。
  3. 添加NoDisplay=true.desktop 文件中。例如,如果你想隐藏Firefox图标,键入以下命令让NoDisplay=true 添加到 .desktop 文件末尾。
$ sudo sh -c 'echo "NoDisplay=true" >> firefox.desktop'
方法 2

另一种方法是将全局应用程序菜单目录(/usr/share/applications/)复制到当前的程序目录下,然后添加或者修改你不想要的 .desktop 文件。这中改变能够在应用程序升级之后得以保存。

  1. 在终端下,复制/usr/share/applications下所有文件到~/.local/share/applications/:
    $ cp /usr/share/applications/* ~/.local/share/applications/
  2. 在任何你想隐藏的菜单下,添加NoDisplay=true 参数:
    $ echo "NoDisplay=true" >> ~/.local/share/applications/foo.desktop

你也能用文本编辑器直接编辑.desktop应用程序的分类:Categories=

方法 3

第三种方法是官方推荐的比较干净的方案Xfce wiki

创建~/.config/menus/xfce-applications.menu文件,复制以下内容到文件中:

<!DOCTYPE Menu PUBLIC "-//freedesktop//DTD Menu 1.0//EN"
  "http://www.freedesktop.org/standards/menu-spec/1.0/menu.dtd">

<Menu>
    <Name>Xfce</Name>
    <MergeFile type="parent">/etc/xdg/menus/xfce-applications.menu</MergeFile>

    <Exclude>
        <Filename>xfce4-run.desktop</Filename>

        <Filename>exo-terminal-emulator.desktop</Filename>
        <Filename>exo-file-manager.desktop</Filename>
        <Filename>exo-mail-reader.desktop</Filename>
        <Filename>exo-web-browser.desktop</Filename>

        <Filename>xfce4-about.desktop</Filename>
        <Filename>xfhelp4.desktop</Filename>
    </Exclude>

    <Layout>
        <Merge type="all"/>
        <Separator/>

        <Menuname>Settings</Menuname>
        <Separator/>

        <Filename>xfce4-session-logout.desktop</Filename>
    </Layout>

</Menu>

<MergeFile> 标签在文件中包含默认的Xfce菜单。这是很必不可少的。

<Exclude> 标签能排除掉某些你不需要的应用程序,比如说firefox.desktop 或者其他任何程序。

<Layout> 标签定义了菜单的布局,应用程序能够按你所想组织文件夹。更多的细节请参见Xfce Wiki。

方法 4

lxmed 这个由Java写成的GUI工具,隶属于LXDE项目,但他也能在Xfce4上良好的工作,你可以在AUR找到 lxmedAUR

如果上面位置找不到启动器怎么办(如wine安装的程序)

一般在~/.local/share/applications/wine/下可以找到。

面板自动隐藏有点延迟

添加以下内容到 ~/.gtkrc-2.0

 style "xfce-panel-window-style"
 {
   # Time in miliseconds before the panel will unhide on an enter event
   XfcePanelWindow::popup-delay = 225
 
   # Time in miliseconds before the panel will hide on a leave event
   XfcePanelWindow::popdown-delay = 350
 }
 class "XfcePanelWindow" style "xfce-panel-window-style"

面板和桌面平级

如果你想面板与桌面平级(就是说让其他窗口叠在上面),你需要小小hack一下,首先确保安装了wmctrl软件包。 在~/.config/xfce4/xfce4-fix-panel 创建脚本,设定权限为可执行(chmod 755 xfce4-fix-panel)。

#!/bin/bash
set -e

function getPanelIdImpl() {
  # get panel id
  PANEL="`wmctrl -l | sed -n -e '/ xfce4-panel$/ s_ .*$__ p' | sed -n -e $1' p'`"
}

function getPanelId() {
  # eventually await the panel to appear
  getPanelIdImpl $1
  while [ x = x$PANEL ] ;do
    sleep 0.5s
    getPanelIdImpl $1
  done
}

function putPanelDown() {
  PANEL=""
  getPanelId $1
  wmctrl -i -r $PANEL -b add,below
}
	
# call the program with a list of panel numbers as arguments
# for example, xfce4-fix-panel 1 2 3
# for the first three panels
for i in $* ;do
  putPanelDown $i
done

保存脚本,测试运行一下,没问题的话你需要让脚本在开机时自动运行。简单的做法是在 会话和启动 -> 应用程序自启动 添加此脚本。

这是处理问题的一种方案,但是要是你的面板还是不能于窗口重叠。你就必须用下面的方法打开这种行为,只需要做一次就行了(改变$ID为你喜欢的值)

xfconf-query -c xfce4-panel -p /panels/panel-$ID/disable-struts -n -t bool -s true

桌面

如何让桌面图标标签字体背景透明

如果想把改变图标下文字默认的白色背景改的更好看,就创建或者修改你的家目录($HOME)下的.gtkrc-2.0文件(当然你也可以添加到正使用主题的gtkrc文件之中),添加如下部分:

style "xfdesktop-icon-view" {
font_name = "sans Bold"			#字体名称设置
XfdesktopIconView::label-alpha = 10	#透明度设置
base[NORMAL] = "#000000"		#背景颜色(下同)
base[SELECTED] = "#71B9FF"
base[ACTIVE] = "#71FFAD"
fg[NORMAL] = "#ffffff"			#文字颜色(下同)
fg[SELECTED] = "#71B9FF"
fg[ACTIVE] = "#71FFAD" }
widget_class "*XfdesktopIconView*" style "xfdesktop-icon-view"

注意,这需要你更换主题或者重新登录生效

如何隐藏桌面上的默认的几个图标

新版本的xfce4已经可以很方便的在桌面点右键或者控制中心设置这个地方了。如果是旧版的xfce4(<=4.4.3),就可以参照下面的方法

默认xfdesktop管理的桌面上会有垃圾箱(trash),Home,文件系统,还有挂载的磁盘等几个图标,如果你不喜欢,或者想隐藏某个,就修改(如果没有就新建) $HOME/.config/xfce4/desktop/xfdesktoprc ,内容类似下面的,true为显示,false为隐藏

[file-icons]
show-filesystem=true
show-home=true
show-trash=true
show-removable=true

隐藏桌面上的分区

如果不想在桌面上看到某些分区的图标可以创建一个udev规则,比如/etc/udev/rules.d/10-local.rules:

Udisk1:

KERNEL=="sda1", ENV{UDISKS_PRESENTATION_HIDE}="1"
KERNEL=="sda2", ENV{UDISKS_PRESENTATION_HIDE}="1"

Udisk2:

KERNEL=="sda1", ENV{UDISKS_PRESENTATION_HIDE}="1"
KERNEL=="sda2", ENV{UDISKS_PRESENTATION_HIDE}="1"

这样就不会看到sda1/2的硬盘出现在桌面上了。

切换到旧式的没有thunar选项的右键菜单

xfconf-query -c xfce4-desktop -v --create -p /desktop-icons/style -t int -s 0

添加终结窗口快捷方式

Xfce 并没有 结束窗口 快捷方式,但是你能用一个简单的脚本做到。当然,需要安装xorg-xkill 软件包。

创建一个脚本 ~/.config/xfce4/killwindow.sh 添加设置可执行权限 ( chmod 755 killwindow.sh)。

xkill -id "`xprop -root -notype | sed -n '/^_NET_ACTIVE_WINDOW/ s/^.*# *\|\,.*$//g p'`"

现在就可以利用设置 -> 键盘添加快捷方式使用脚本了。

XFWM4

如何开启Xfce 的混合特性

Xfce 4.8 内置了一个带有真透明在内的多种混合特性的窗口特效。 不需要对/etc/xorg.conf额外的设置就可以开启特效:

Menu  -->  Settings  -->  Window Manager Tweaks

禁用 roll-up

xfconf-query -c xfwm4 -p /general/mousewheel_rollup -s false

禁用窗口边缘自动缩放和平铺窗口

XFWM4 可以在窗口位于屏幕边缘时自动平铺窗口,并将窗口自动缩放到屏幕一半高度。可以通过如下方法禁用:

  • Window Manager Tweaks --> Accessibility --> Automatically tile windows when moving toward the screen edge
  • 或者:
xfconf-query -c xfwm4 -p /general/tile_on_move -s false  # To disable
xfconf-query -c xfwm4 -p /general/tile_on_move -s true   # To enable

用命令管理设置

这些都是非官方文档中的命令。 必须查阅 /usr/share/applications/ 文件夹中的.desktop 文件。如果人们想知道发生了什么,这个列表或许对你有一些帮助:

xfce-setting-show backdrop
xfce-setting-show display
xfce-setting-show keyboard
xfce4-menueditor
xfce-setting-show sound
xfce-setting-show mouse
xfce-setting-show session
xfce-setting-show
xfce-setting-show splash
xfce-setting-show ui
xfce-setting-show xfwm4
xfce-setting-show wmtweaks
xfce-setting-show workspaces
xfce-setting-show printing_system
xfce4-appfinder
xfce4-autostart-editor
xfce4-panel -c

如果想要查阅更多的命令行设置,在终端运行下面的命令:

$ grep xfce-setting-show /usr/share/applications/xfce*settings*

会话

如何自定义启动应用程序

这里包含了所必须的环境变量。

  • 复制 /etc/xdg/xfce4/xinitrc 到 ~/.config/xfce4/
  • 编辑这个文件,在这个文件中间某处添加一些你想要的,如:
  • source $HOME/.bashrc
  • # start rxvt-unicode server
  • urxvtd -q -o -f

注:如果只是想要让xfce4启动时默认启动一些东西,那么还可以修改$HOME/.xprofile,或者xfce4-autostart-editor。定义启动时需要启动的xfce4组件可以通过保存会话来实现

切换用户

Xfce4 的动作按钮菜单中可以切换用户,目前 gdmlightdm 都提供了此功能。

修改 XML 设定文件和目录

这应该是可用的,尤其是在升级之后,手动修改 .xml 文件 ~/.config/xfce4/xfconf/ 。比如说修改某些程序的键盘快捷键 (~/.config/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml)。这种方法便于拷贝来达到GUI更好的使用效果。

可移除的设备

如果你想要在thunar文件管理器上显示刚插入的设备,首先应当安装gvfs.

也可能需要安装gvfs-afc (参考 this discussion):

还有一个好方法,可以安装thunar-volman (包含在xfce4组中):

如果你使用光驱或者其他外部设备,udisk也建议安装。

如何给XFCE添加主题

1. 可以去xfce-look.org 下载好你喜欢的主题。

2. 把下载的主题文件解压。

3. 将解压好的文件移动到/usr/share/themes (所有的用户都可以使用) 或者 ~/.themes (只有自己能用). 例如 /usr/share/themes/abc, 这个文件夹中你创建一个xfwm4为名的文件夹,几乎所有的主题文件都会在这里。

4. 使用GTK的主题在这里设置:

Menu --> Settings --> Appearance

选择xfwm的主题在下面这里设置:

Menu --> Settings --> Window Manager

鼠标指针

默认情况下,X会使用一个二维的黑色指针。如过安装了新的鼠标主题,可以在如下地方设置指针:

Menu --> Settings --> Mouse --> Theme

想要安装新的指针主题,请参看xcursor-themes_(简体中文)xcursor_(简体中文) , 或者X11 Cursors_(简体中文).

字体

如果你的标准字体看起来不舒适,那么打开 Settings>Appearence 中的字体选项条,启用光滑字体打钩选择全部。

如果你明白可以适当的调整DPI的数值达到更好看的效果。

声音

xfce4-mixer 是 Xfce 组开发的用户混音程序和面板插件,是 xfce4 组的一部分,所以应该已经安装。它使用 gstreamer 作为控制音量的后端,所以必须安装 xfce4-mixer 列出的可选依赖关系,否则点击时会出现如下错误:

 GStreamer was unable to detect any sound devices. Some sound system specific GStreamer packages may be missing. It may also be a permissions problem.

需要的插件由硬件觉得,大部分用户需要 安装 软件包 gstreamer0.10-base-plugins. 如果面板已经启动,安装后需要重新登陆,或删除再加入。如果不能工作,可能还需要其他插件如gstreamer0.10-good-pluginsgstreamer0.10-bad-plugins.

更多关于默认声卡的设置请阅读 Advanced Linux Sound Architecture。此外还可以使用 PulseAudiopavucontrol.

使用OSS驱动如何让xfce4-mixer来控制音量

新版的xfce4-mixer使用了gstreamer作为后端,这样就不用直接与驱动交流,更加统一。与驱动打交道的工作交给了gstreamer。因此如果你xfce4-mixer无法正常工作,就需要配置好gstreamer。首先当然你得安装xfce4-mixer。

 pacman -S xfce4-mixer gstreamer0.10-base-plugins

你需要至少安装gstreamer0.10-good-plugins,考虑安装gstreamer0.10-bad-plugins

 pacman -S gstreamer0.10-good-plugins gstreamer0.10-bad-plugins

然后删除面板上的mixer插件,然后重新添加一次,或者先登出然后再登录一次,对gstreamer做更改后必须这样做才能让操作生效。

也能够下载PKGBUILD 或者其他你需要的ABShere, 修改 PKGBUILD, 添加参数 --enable-oss.

 ./configure --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
   --enable-oss \
   --disable-static --enable-experimental \
   --disable-schemas-install \
   --disable-hal \
   --with-package-name="GStreamer Good Plugins (Archlinux)" \
   --with-package-origin="https://www.archlinux.org/"

然后开始安装:

 makepkg -i

如果失败,没有效果,就直接尝试使用AUR里面的 gstreamer0.10-good-plugins-ossv4AUR,替换掉gstreamer0.10-good-plugins即可

如果仍然失败,就到论坛发贴求助,或者到OSS官方论坛查看[1]

使用快捷键改变音量

使用xbindkeys也可以达到相同的效果。

Settings --> Keyboard

单击"Application Shortcuts" 选项卡中 "Add" 按钮. 输入命令即可添加快捷键了。

ALSA

升高音量:

amixer set Master 5%+

降低音量:

amixer set Master 5%-

静音:

amixer set Master toggle

你如果使用的是标准的XF86Audio 快捷键,在在终端输入以下内容:

xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioRaiseVolume -n -t string -s "amixer set Master 5%+ unmute"
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioLowerVolume -n -t string -s "amixer set Master 5%- unmute"
xfconf-query -c xfce4-keyboard-shortcuts -p /commands/custom/XF86AudioMute -n -t string -s "amixer set Master toggle"

amixer set Master toggle 不工作,尝试使用调节PCM直接调节音量(amixer set PCM toggle) 。

这个频段必须使用"mute" 参数工作。要检查计算机是否支持mute,运行alsamixer 在终端查看Master条上是否有两个M (MM) 。 若没有显示,则你的电脑可能不支持mute参数。假如你不得不切换使用PCM改变音量,那必须确保你的xfce-mixer也要调节PCM通道,而不是普通的Master通道。

OSS

使用脚本文件: [http://www.opensound.com/wiki/index.php/Tips_And_Tricks#Using_multimedia_keys_with_OSS ]

如果你使用ossvol (推荐): 升高音量:

ossvol -i 1

降低音量:

ossvol -d 1

静音/取消静音:

ossvol -t

如果使用 pulseaudio 时 xfce4-volumed 无法静音,请尝试:

xfconf-query -c xfce4-mixer -p /active-card -s `xfconf-query -c xfce4-mixer -p /sound-card`
Xfce4-volumed

xfce4-volumed 来自AUR的daemon。能自动识别键盘的多媒体按键适用于Xfce-mixer。并能通过OSD通知音量变化的情况。Xfce4-volumed 不需要任何设置即可开始工作。

Tango-inaccurate.pngThe factual accuracy of this article or section is disputed.Tango-inaccurate.png

Reason: There should be a short explanation of what this does and why it fixes the issue (bug?). (Discuss in Talk:Xfce (简体中文)#)

假如你使用pulseaudio 和 xfce4-volumed 取消静音不能正常使用尝试一下命令:

$ xfconf-query -c xfce4-mixer -p /active-card -s `xfconf-query -c xfce4-mixer -p /sound-card`
Volumeicon

volumeicon is an alternative to xfce4-volumed in the community repo also handling keybindings and notifications through xfce4-notifyd.

Adding startup/boot sound

Arch does not have a built-in startup sound configuration tool, but there is a workaround by adding the following command to your Application Autostart settings:

aplay /boot/startupsound.wav

The file location and filename can be whatever you want, but naming it descriptively and putting it in /boot keeps things tidy.

xdg-open integration (Preferred Applications)

Most applications rely on xdg-open for opening a preferred application for a given file or URL.

In order for xdg-open and xdg-settings to detect and integrate with the XFCE desktop environment correctly, you need to install the xorg-xprop package.

If you do not do that, your preferred applications preferences (set by exo-preferred-applications) will not be obeyed. Installing the package and allowing xdg-open to detect that you are running XFCE makes it forward all calls to exo-open instead, which correctly uses all your preferred applications preferences.

To make sure xdg-open integration is working correctly, ask xdg-settings for the default web browser and see what the result is:

# xdg-settings get default-web-browser

If it replies with:

xdg-settings: unknown desktop environment

it means that it has failed to detect XFCE as your desktop environment, which is likely due to a missing xorg-xprop package.

截屏

XFCE has its own screenshot tool, xfce4-screenshooter. It is part of the xfce4-goodies group.

使用print-screen按键

XFCE Menu  -->  Settings  -->  Keyboard  >>>  Application Shortcuts.

Add the "xfce4-screenshooter -f" command to use the "PrintScreen" key in order to take fullscreen screenshots. See screenshooter's man page for other optional arguments.

Alternatively, an independent screenshot program like scrot can be used.

Terminal color themes or pallets

Terminal color themes or pallets can be changed in GUI under Appearance tab in Preferences. These are the colors that are available to most console applications like Emacs, Vi and so on. Their settings are stored individually for each system user in ~/.config/xfce4/terminal/terminalrc file. There are also so many other themes to choose from. Check forums post [Colour Scheme Screenshots] for hundreds of available choices and themes.

Changing default color theme

XFCE's extra/terminal package comes with a darker color palette and colored text looks pretty horrid in default black background impeding user readability. Append the following in your terminalrc file for a lighter color theme, that is always visible in darker Terminal backgrounds.

~/.config/xfce4/terminal/terminalrc
ColorPalette5=#38d0fcaaf3a9
ColorPalette4=#e013a0a1612f
ColorPalette2=#d456a81b7b42
ColorPalette6=#ffff7062ffff
ColorPalette3=#7ffff7bd7fff
ColorPalette13=#82108210ffff

终端之Tango主题

用你喜欢的编辑器打开~/.config/xfce4/terminal/terminalrc加入:

ColorForeground=White
ColorBackground=#323232323232
ColorPalette1=#2e2e34343636
ColorPalette2=#cccc00000000
ColorPalette3=#4e4e9a9a0606
ColorPalette4=#c4c4a0a00000
ColorPalette5=#34346565a4a4
ColorPalette6=#757550507b7b
ColorPalette7=#060698989a9a
ColorPalette8=#d3d3d7d7cfcf
ColorPalette9=#555557575353
ColorPalette10=#efef29292929
ColorPalette11=#8a8ae2e23434
ColorPalette12=#fcfce9e94f4f
ColorPalette13=#72729f9fcfcf
ColorPalette14=#adad7f7fa8a8
ColorPalette15=#3434e2e2e2e2
ColorPalette16=#eeeeeeeeecec

Colour management

xfce4-settings-manager does not yet have any colour management / calibration settings, nor is there any specific XFCE program to characterise your monitor.

Loading a profile

If you wish to load an icc profile (that you have previously created or downloaded) to calibrate your display on startup, you can download xcalibAUR from AUR, then open the XFCE4 Settings Manager, click Session and Startup icon, the Autostart tab, and add a new entry where the command is /usr/bin/xcalib /path/to/your/profile.icc. You still need to tell your applications, which display profile should be used to have the displayed images colour managed.

Another option is dispwin. Dispwin not only calibrates the display, but also sets the _ICC_PROFILE atom in X so that some applications can use a "system" display profile instead of requiring the user to set the display profile manually (GIMP, Inkscape, darktable, UFRaw, etc.).

See ICC_Profiles#Loading_ICC_Profiles for more information.

Creating a profile

If you wish to create an icc profile for your display (ie. characterising/profiling, e.g. with the ColorHug, or some other colorimeter, or a spectrophotometer, or "by eye"), the simplest option may be to install dispcalGUI from AUR.

Another option is gnome-control-center (available in extra), which has a much simpler GUI, but less options and requires installing some Gnome dependencies. In order to start the calibration from the command line, first do colormgr get-devices and look for the "Device ID" line of your monitor. If this is e.g. "xrandr-Lenovo Group Limited", you start calibration with the commabnd gcm-calibrate --device "xrandr-Lenovo Group Limited".

Note: It seems like you need to run the full gnome-control-center because XFCE does not yet have a session component for colord: https://bugzilla.xfce.org/show_bug.cgi?id=8559

See ICC Profiles for more information.

Multiple Monitors

If you have configured X.org so that your display spans multiple monitors, usually when you login to an XFCE session, it will appear as if your monitors are simple clones of one another. You can use an xrandr tool to tweak your setup but if this is not called at an appropriate time in the startup sequence, some functionality may be lost with parts of your display being inaccessible to the mouse pointer.

A better way is to configure XFCE to match your desired display arrangement. However, at present (xfce-settings 4.10), there is no tool available to assist with configuring multiple monitors directly.

  • The Settings -> Display tool does allow configuration of screen resolution, rotation and enabling individual monitors; warning: using this tool to adjust display settings will reset or lose settings made manually for properties not explicitly offered as buttons in the tool (see below).
  • The Settings -> Settings Editor allows manipulation of all configuration items in particular the displays settings which are saved in the file displays.xml below
~/.config/xfce4/xfconf/xfce-perchannel-xml
  • Alternatively, the displays.xml can be edited using your favourite editor.

The main requirement for multiple monitors is their arrangement relative to one another. This can be controlled by setting the Position properties (X and Y) to suit; an (x,y) position of 0,0 corresponds to the top, left position of the monitor array. This is the default position for all monitors and if several monitors are enabled they will appear as a cloned display area extending from this point.

To extend the display area correctly across both monitors:

  • for side-by-side monitors, set the X property of the rightmost monitor to equal the width of the left-most monitor
  • for above-and-below monitors, set the Y property of the bottom monitor to equal the height of the upper monitor
  • for other arrangements, set the X and Y properties of each monitor to correspond to your layout

Measurements are in pixels. As an example, a pair of monitors with nominal dimensions of 1920x1080 which are rotated by 90 and placed side-by-side can be configured with a displays.xml like this:

<channel name="displays" version="1.0">
 <property name="Default" type="empty">
   <property name="VGA-1" type="string" value="Idek Iiyama 23"">
     <property name="Active" type="bool" value="true"/>
     <property name="Resolution" type="string" value="1920x1080"/>
     <property name="RefreshRate" type="double" value="60.000000"/>
     <property name="Rotation" type="int" value="90"/>
     <property name="Reflection" type="string" value="0"/>
     <property name="Primary" type="bool" value="false"/>
     <property name="Position" type="empty">
       <property name="X" type="int" value="0"/>
       <property name="Y" type="int" value="0"/>
     </property>
   </property>
   <property name="DVI-0" type="string" value="Digital display">
     <property name="Active" type="bool" value="true"/>
     <property name="Resolution" type="string" value="1920x1080"/>
     <property name="RefreshRate" type="double" value="60.000000"/>
     <property name="Rotation" type="int" value="90"/>
     <property name="Reflection" type="string" value="0"/>
     <property name="Primary" type="bool" value="false"/>
     <property name="Position" type="empty">
       <property name="X" type="int" value="1080"/>
       <property name="Y" type="int" value="0"/>
     </property>
   </property>
 </property>
</channel>

Usually, editing settings in this way requires a logout/login to action them.

A new method for configuring multiple monitors will be available in the forthcoming xfce-settings 4.12 release.

XDG 用户目录

freedesktop.org specifies the "well known" user directories like the desktop folder and the music folder. See Xdg user directories for detailed info.

常见问题与解答

xfce4-power-manager 不工作

检查 dbus DAEMONS 是否添加到了/etc/rc.conf

Xfce4-xkb-plugin settings issue

There is a bug in version 0.5.4.1-1 which causes xkb-plugin to lose keyboard, layout switching and compose key settings. As a workaround you may enable Use system defaults option in keyboard settings. To do so run

xfce4-keyboard-settings

Go to Layout tab and set the Use system defaults flag, then reconfigure xkb-plugin.

Thunar 不显示缩略图

Thunar 已经支持 Tumbler 选项,只要安装Tumbler:

pacman -S tumbler

更详细内容请参考 Thunar Wiki.

Locales 设置被GDM忽略

成为超级用户添加locales到 /var/lib/AccountsService/users/$USER:

su -c "nano /var/lib/AccountsService/users/$USER"

用你自己的locales代替 hu_HU.UTF-8 :

[User]
Language=hu_HU.UTF-8
XSession=xfce

也可以利用sed程序。 注意在 .UTF-8前面加 "/":

su -c "sed -i 's/Language=.*/Language=hu_HU\.UTF-8/' /var/lib/AccountsService/users/$USER"

重启GDM。

恢复默认设置

若你折腾到想还原xfce4的默认设置,重命名 ~/.config/xfce4-session/~/.config/xfce4/就可以了XD

$ mv ~/.config/xfce4-session/ ~/.config/xfce4-session-bak
$ mv ~/.config/xfce4/ ~/.config/xfce4-bak

注销后生效。

NVIDIA 和 xfce4-sensors-plugin

要探测NVIDIA的gpu温度需要安装 libxnvctrlAUR 并且重新编译 xfce4-sensors-plugin 软件包。

会话错误

如果窗口管理器不能正常运行(鼠标是一个X形,或者不能关闭窗口),不能正常还原,这时候说明会话出错。 删除掉session及其.cache 文件夹。

# rm -r ~/.cache/sessions/

在重启计算机之后会话应该就还原正常了。(只重启Xfce亦可)

升级Xfce 4.10以后window buttons不能自动扩展长度

这种情况导致类似windows布局的panel始终和通知区域来回移动,不能定位在右下方。 原因是新版的Window Buttons panel plugin不能自动适应面板长度。

为了回到之前的效果,可以在Window Buttons之后添加一个分隔符,属性选中"扩展"。

Preferred Applications preferences have no effect

If you have set your preferred applications with exo-preferred-applications, but they do not seem to be taken into consideration, see Xfce#xdg-open_integration_.28Preferred_Applications.29

Action Buttons in the panel are missing icons

This happens if icons for some actions (Suspend, Hibernate) are missing from the icon theme, or at least do not have the expected names. First, find out the currently used icon theme in the Settings Manager (→Appearance→Icons). Match this with a subdirectory of /usr/share/icons. For example, if the icon theme is GNOME, make a note of the directory name /usr/share/icons/gnome.

icontheme=/usr/share/icons/gnome

Make sure that the xfce4-power-manager is installed as this contains the needed icons. Now create symbolic links from the current icon theme into the hicolor icon theme.

ln -s /usr/share/icons/hicolor/16x16/actions/xfpm-suspend.png   ${icontheme}/16x16/actions/system-suspend.png
ln -s /usr/share/icons/hicolor/16x16/actions/xfpm-hibernate.png ${icontheme}/16x16/actions/system-hibernate.png
ln -s /usr/share/icons/hicolor/22x22/actions/xfpm-suspend.png   ${icontheme}/22x22/actions/system-suspend.png
ln -s /usr/share/icons/hicolor/22x22/actions/xfpm-hibernate.png ${icontheme}/22x22/actions/system-hibernate.png
ln -s /usr/share/icons/hicolor/24x24/actions/xfpm-suspend.png   ${icontheme}/24x24/actions/system-suspend.png
ln -s /usr/share/icons/hicolor/24x24/actions/xfpm-hibernate.png ${icontheme}/24x24/actions/system-hibernate.png
ln -s /usr/share/icons/hicolor/48x48/actions/xfpm-suspend.png   ${icontheme}/48x48/actions/system-suspend.png
ln -s /usr/share/icons/hicolor/48x48/actions/xfpm-hibernate.png ${icontheme}/48x48/actions/system-hibernate.png

Log out and in again, and you should see icons for all actions.

修改挂载参数

比较常见的问题是自动挂载USB设备后,其中FAT文件系统的编码总是探测失败,ñ, ß, etc. 默认用utf8的iocharset编码能够有效解决这个问题,添加以下内容至/etc/xdg/xfce4/mount.rc

[vfat]
uid=<auto>
shortname=winnt
utf8=true
# FreeBSD specific option
longnames=true
flush=true

当你使用utf-8时,文件系统小心的探测文件中的内容。

还有一个比较推荐添加的 flush参数 ,以免数据频繁更新导致拖慢thunar的复制进程。Adding async instead will speed up write ops, but make sure to use Eject option in Thunar to unmount the stick. Globally, mount options for storage devices present at boot can be set in fstab, and for other devices in udev rules.

相关文章