个人工具
登录
查看“Fluxbox指南”的源代码 - Ubuntu中文
页面
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“Fluxbox指南”的源代码
来自Ubuntu中文
←
Fluxbox指南
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
引自fluxbox官方网站 原文地址: [http://fluxbox.sourceforge.net/docbook/zh_cn/fluxbox-docs.html] <html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>Fluxbox 文档</title><meta name="generator" content="DocBook XSL Stylesheets V1.64.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="zh_cn"><div class="titlepage"><div><div><h1 class="title"><a name="id2401362"></a>Fluxbox 文档</h1></div><div><div class="author"><h3 class="author"><span class="firstname">Tobias</span> <span class="surname">Klausmann</span></h3></div></div><div><p class="othercredit"><span class="firstname">Rando</span> <span class="surname">Christensen</span></p></div><div><p class="othercredit"><span class="contrib">“安装 Fluxbox”</span>: <span class="firstname">Jason</span> <span class="surname">Gillman</span>, <span class="lineage">Jr.</span></p></div><div><p class="othercredit"><span class="contrib">“主题入门”</span>: <span class="firstname">Justin</span> <span class="surname">Rebelo</span></p></div><div><p class="othercredit"><span class="contrib">文档简体中文翻译</span>: <span class="firstname">Colville</span> <span class="surname">Mei</span></p></div><div><div class="revhistory"><table border="1" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>修订历史</b></th></tr><tr><td align="left">修订 0.4</td><td align="left">2003-09-16</td><td align="left">eg</td></tr><tr><td align="left" colspan="3"> New editor in charge. Add revision history. Revisite Key Actions (crosscheck with FbCommandFactory.cc). </td></tr></table></div></div></div><div></div><hr></div><div class="toc"><p><b>目录</b></p><dl><dt><span class="chapter"><a href="#id2537187">1. 简介</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id2524422">关于此文档</a></span></dt><dt><span class="sect1"><a href="#id2468632">关于 Fluxbox</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2468637">Fluxbox 是何物?</a></span></dt><dt><span class="sect2"><a href="#id2468655">功能</a></span></dt><dt><span class="sect2"><a href="#id2468744">获取 Fluxbox</a></span></dt><dt><span class="sect2"><a href="#id2468762">提问和获取支持</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id2462223">2. 起步</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id2486584">安装 Fluxbox</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2519629">获取源代码</a></span></dt><dt><span class="sect2"><a href="#id2528465">解压缩和编译</a></span></dt><dt><span class="sect2"><a href="#id2525036">运行 Fluxbox</a></span></dt><dt><span class="sect2"><a href="#id2532958">其它事项</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id2524954">3. 工具</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id2454686">简介</a></span></dt><dt><span class="sect1"><a href="#id2544922">fbrun</a></span></dt><dt><span class="sect1"><a href="#sect-fbgm">fluxbox-generate_menu</a></span></dt><dt><span class="sect1"><a href="#sect-fluxspace">fluxspace</a></span></dt><dt><span class="sect1"><a href="#sect-wmctrl">wmctrl</a></span></dt><dt><span class="sect1"><a href="#sect-pager">Pagers</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-tabs">4. 标签</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id2250715">标签入门</a></span></dt><dt><span class="sect1"><a href="#id2521075">标签的高级话题</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2521079">Sloppy Window Grouping</a></span></dt><dt><span class="sect2"><a href="#id2521099">Tabbing single window classes</a></span></dt><dt><span class="sect2"><a href="#id2517407">完全禁用标签</a></span></dt><dt><span class="sect2"><a href="#id2528059">Tab Placement</a></span></dt><dt><span class="sect2"><a href="#id2528082">Tab Autogrouping</a></span></dt><dt><span class="sect2"><a href="#id2540960">主题中的标签</a></span></dt></dl></dd></dl></dd><dt><span class="chapter"><a href="#id2540314">5. 按键绑定</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id2540319">Keygrabber</a></span></dt><dt><span class="sect1"><a href="#id2522393">按键名称</a></span></dt><dt><span class="sect1"><a href="#id2539190">动作</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-bg">6. 桌面背景</a></span></dt><dt><span class="chapter"><a href="#chap-slit">7. Slit</a></span></dt><dt><span class="chapter"><a href="#chap-toolbar">8. 工具栏</a></span></dt><dt><span class="chapter"><a href="#id2537269">9. 菜单编辑</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id2541978">设置菜单文件位置</a></span></dt><dt><span class="sect1"><a href="#id2542014">可用的命令</a></span></dt></dl></dd><dt><span class="chapter"><a href="#chap-themes">10. 主题</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id2537184">主题的入门</a></span></dt><dt><span class="sect1"><a href="#id2543471">主题的高阶编辑</a></span></dt></dl></dd><dt><span class="appendix"><a href="#app-setup">A. 建立 .xinitrc/.xsession</a></span></dt><dt><span class="appendix"><a href="#faq">B. Frequently asked questions (FAQ)</a></span></dt><dt><span class="appendix"><a href="#app-themeref">C. Theme Reference</a></span></dt><dd><dl><dt><span class="sect1"><a href="#id2511508">Theme directives</a></span></dt></dl></dd><dt><span class="appendix"><a href="#app-artwiz">D. 在 Fluxbox 中使用 Artwiz 字体</a></span></dt><dt><span class="appendix"><a href="#app-debugging">E. 调试</a></span></dt></dl></div><div class="list-of-tables"><p><b>表格列表</b></p><dl><dt>5.1. <a href="#id2524493">Navigation</a></dt><dt>5.2. <a href="#id2524599">Window Operations</a></dt><dt>5.3. <a href="#id2524974">Window Sizing</a></dt><dt>5.4. <a href="#id2525238">窗口移动</a></dt><dt>5.5. <a href="#id2537438">杂项</a></dt><dt>10.1. <a href="#id2468836">Texture directives</a></dt><dt>C.1. <a href="#id2540397">Toolbar styles</a></dt><dt>C.2. <a href="#id2535104">Menu styles</a></dt><dt>C.3. <a href="#id2535929">Window styles</a></dt><dt>C.4. <a href="#id2538470">Handlebar styles</a></dt><dt>C.5. <a href="#id2536215">Resize grip styles</a></dt><dt>C.6. <a href="#id2536291">Window button styles</a></dt><dt>C.7. <a href="#id2536052">Window frame styles</a></dt><dt>C.8. <a href="#id2536098">Tab styles</a></dt><dt>C.9. <a href="#id2539755">Font on window label styles</a></dt><dt>C.10. <a href="#id2539810">Miscellaneous styles</a></dt></dl></div><div class="list-of-examples"><p><b>示例列表</b></p><dl><dt>4.1. <a href="#id2513324">groups file</a></dt><dt>5.1. <a href="#id2524682">Fluxbox keysfile</a></dt><dt>5.2. <a href="#id2522362">XMMS 按键绑定</a></dt><dt>5.3. <a href="#id2522377">Multimedia keys for XMMS</a></dt><dt>5.4. <a href="#id2522408">按下右箭头键后 xev 的输出</a></dt><dt>7.1. <a href="#id2524449">指定 Slitlist </a></dt><dt>8.1. <a href="#id2467524">工具栏的工具示例</a></dt><dt>9.1. <a href="#id2541994">设置菜单文件</a></dt><dt>9.2. <a href="#id2488978">菜单文件</a></dt><dt>10.1. <a href="#id2528005">Toolbar Clock style</a></dt><dt>10.2. <a href="#id2528023">Menu style</a></dt><dt>10.3. <a href="#id2468783">Font style</a></dt><dt>10.4. <a href="#id2468818">Texture style</a></dt><dt>10.5. <a href="#id2540714">Typical short style</a></dt><dt>A.1. <a href="#id2537075">.xinitrc</a></dt><dt>B.1. <a href="#id2525140">在 style 文件中自定义标签</a></dt><dt>D.1. <a href="#id2511556">fonts.dir</a></dt></dl></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="id2537187"></a>章 1. 简介</h2></div></div><div></div></div><div class="toc"><p><b>目录</b></p><dl><dt><span class="sect1"><a href="#id2524422">关于此文档</a></span></dt><dt><span class="sect1"><a href="#id2468632">关于 Fluxbox</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2468637">Fluxbox 是何物?</a></span></dt><dt><span class="sect2"><a href="#id2468655">功能</a></span></dt><dt><span class="sect2"><a href="#id2468744">获取 Fluxbox</a></span></dt><dt><span class="sect2"><a href="#id2468762">提问和获取支持</a></span></dt></dl></dd></dl></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2524422"></a>关于此文档</h2></div></div><div></div></div><p>这是 Fluxbox -- 一个 X11 窗口管理器 -- 的更新文档。 该文档的早期版本只有HTML格式,目的是为了较为容易的 移植到其他输出格式。源文件是用 DocBook 4.1编写的,此格式是专为为编写文档而量身定做的。</p><p>到目前为止已经有一些 Fluxbox 的文档维护人员了。 您现在阅读的文档大部分都是基于 Rando Christensen <tt class="email"><<a href="mailto:rando@babblica.net"><a href="mailto:rando@babblica.net" target="_top">rando@babblica.net</a></a>></tt> 的工作成果,或最初由他发起,之后<tt class="email"><<a href="mailto:%20klausman@users.sourceforge.net%20"><a href="mailto:klausman@users.sourceforge.net" target="_top"> klausman@users.sourceforge.net </a></a>></tt> 协同其他几位人员共同完成的。如果遗漏了哪位,请告知<tt class="email"><<a href="mailto:%E7%BC%96%E8%BE%91%E4%BA%BA%E5%91%98"><a href="mailto:grubert@users.sourceforge.net" target="_top">编辑人员</a></a>></tt> 予以修正。</p><p>如果您对这篇中文版文档有什么疑问,或者建议和意见,请发邮件给<tt class="email"><<a href="mailto:%20Colville%20Mei%20"><a href="mailto:colvillegnome@hotmail.com" target="_top"> Colville Mei </a></a>></tt>, 共同探讨简体中文版的文档的各种问题。</p><p>有关 Fluxbox 本身的问题最好投到邮件列表上。 您可以在<a href="http://fluxbox.sourceforge.net/download.php" target="_top"> Fluxbox 官方主页</a> 上找到相关的订阅信息。</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">提交和翻译</h3><p>只要用户认为有价值,任何书写清晰,可读性强,而此处未能涵盖的 文档,我都可以接受;如果您想帮助我们而无从下手或者想添加文档的话,只要按上面的邮箱地址给我发电子邮件 就可以了。</p></div><p> 本文档的源文件和各种转换后的格式如 HTML 和 PostScript 都可以从 Fluxbox 站点上获得。如果您想用不同的 DTD 或别的输出格式,别忘了源文件这个 老伙计,但是您可能需要一些 DocBook 的知识才能修改 DTD。如果您想转换的格式在 Fluxbox 站点上没有提供,<span class="application">docbook2x</span> 软件包也许能派上用场。</p></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2468632"></a>关于 Fluxbox</h2></div></div><div></div></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2468637"></a>Fluxbox 是何物?</h3></div></div><div></div></div><p>Fluxbox 是 X 平台上的另一个窗口管理器。基于 Blackbox 0.61.1 代码。Fluxbox 外观和 Blackbox 相似,在 外观,颜色,窗口放置等类似事情的处理上则和 Blackbox 完全一样(主题/样式 100%的兼容)。</p><p>那么 Fluxbox 和 Blackbox 到底有什么区别呢? 回答是:太多了!下面这张表中列出了 Fluxbox 已经具备,或 正在研发的功能... </p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2468655"></a>功能</h3></div></div><div></div></div><p> 已实现的: </p><div class="itemizedlist"><ul type="disc"><li><p>可配置的窗口标签</p></li><li><p>反锯齿支持(Xft)</p></li><li><p>UTF-8 支持</p></li><li><p>图标栏(对窗口进行最小化/图标化窗口)</p></li><li><p>窗口/标签的自动分组</p></li><li><p>用滚轮鼠的滚轮切轮换 workspace </p></li><li><p>可配置的标题栏(放置按钮,新按钮等等)</p></li><li><p>KDE 和 Gnome(including Gnome 2)支持</p></li><li><p>Extended Window Manager Hints(ewmh)支持</p></li><li><p>内置集成的 keygrabber(支持类似 emacs 中的 keychains)</p></li><li><p>可覆盖 slit 的最大化操作</p></li><li><p>Slit 中 dockapps 的排序</p></li></ul></div><p> 计划中的: </p><div class="itemizedlist"><ul type="disc"><li><p>Session 管理</p></li><li><p>Windows snapping</p></li><li><p>可配置的工具栏</p></li><li><p>其它次要功能</p></li></ul></div><p> 除此之外,代码也有很多修改和改进的地方。</p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2468744"></a>获取 Fluxbox</h3></div></div><div></div></div><p> Fluxbox 源码可以从 Fluxbox 主站点处下载, <a href="http://fluxbox.sourceforge.net/" target="_top">http://fluxbox.sourceforge.net/</a>。 大多数 Linux 发行版以及其它免费 Unix 包含了 Fluxbox 的源代码和二进制软件包。 实在拿不准的话,就使用发行版提供的最新软件包。</p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2468762"></a>提问和获取支持</h3></div></div><div></div></div><p>Fluxbox 使用和配置都相当简单,但有时候您也会遇到一些疑问和问题。 它们中的大部分以前都有人问到或解决了。所以,当您在邮件列表或 Fluxbox 的 IRC 频道上提问时,请先看一看<a href="#faq" title="附录 B. Frequently asked questions (FAQ)">附录 B, <i>Frequently asked questions (FAQ)</i></a></p></div></div></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="id2462223"></a>章 2. 起步</h2></div></div><div></div></div><div class="toc"><p><b>目录</b></p><dl><dt><span class="sect1"><a href="#id2486584">安装 Fluxbox</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2519629">获取源代码</a></span></dt><dt><span class="sect2"><a href="#id2528465">解压缩和编译</a></span></dt><dt><span class="sect2"><a href="#id2525036">运行 Fluxbox</a></span></dt><dt><span class="sect2"><a href="#id2532958">其它事项</a></span></dt></dl></dd></dl></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2486584"></a>安装 Fluxbox</h2></div></div><div></div></div><p>此节由 Jason Gillman Jr. aka “Ircaddict”撰写。</p><p>许多发行版都提供了 Fluxbox 的二进制软件包(或者 像 Gentoo 和 FreeBSD 那样采用 ports/ebuilds 的),使得安装 Fluxbox 十分轻松。 然而某些情况下您也许不得不从源代码开始编译。例如,Fluxbox 的大多数 最新版本或许并没有以发行版的软件包形式提供。另外,有些人更喜欢采用自己 的一套编译器标志,以达到量身定制的目的。如果您想采用发行版提供的软件包, 请咨询相关发行版的文档。在 Fluxbox 站点上,我们为某些发行版同时提供了源代码 和二进制软件包。</p><p>此文档的目的在于帮助那些还不是十分熟悉X11窗口系统(或一般的 Linux)的人们编译并安装Fluxbox。</p><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2519629"></a>获取源代码</h3></div></div><div></div></div><p>您要做的第一件事就是前往<a href="http://fluxbox.sourceforge.net/download.php" target="_top">下载页面</a> 去下载源代码包(扩展名是.tar.gz)。</p><p>我们也会不定期的放出所谓的 developer releases。从中您可以了解到日后正式版 里可能会引入的新功能。鉴于 developer-release 的特性,所以它们在功能性及稳定性上难免有不足之处。 但想要体验 Fluxbox 的最新特色的话不妨一试--利益与风险并存。在 Fluxbox 官方站点上的 News 区可以找到如何获取它们的方法。</p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2528465"></a>解压缩和编译</h3></div></div><div></div></div><p>很好,既然您已经将源代码包弄到手,该是拆开一探究竟的时候了。 运行下面的命令即可,注意文件名要和您实际下载的文件相符:</p><pre class="programlisting"> $ tar xzvf fluxbox-0.1.12.tar.gz </pre><p>其间屏幕上的列出的文件名对应于正在解压的文件。之后,进入 刚刚创建的目录(它的名称应该是类似于<tt class="filename"> fluxbox-0.1.12/</tt>这样,但具体要依版本而定)。 接下来就要对 Fluxbox 进行 configure 和 make 了。在 configure 运行的时候,您可以选择启用或者禁用 Fluxbox 中的某些功能。对于大多数人而言,采用默认配置就可以了。如果您想在 Fluxbox 的 slit 中看到 KDE 的面板图标,就要加上<b class="userinput"><tt> --enable-kde </tt></b>选项。要了解 configure 脚本 提供的其他选项,使用<b class="userinput"><tt> --help </tt></b>即可。如果您不想启用 KDE, 照着下面做就够了:</p><pre class="programlisting"> $ ./configure $ make </pre><p>待 Fluxbox 编译好后,切换到 root 用户,运行:</p><pre class="programlisting"> # make install </pre><p>恭喜恭喜,您已经顺利完成了编译和安装。</p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2525036"></a>运行 Fluxbox</h3></div></div><div></div></div><p>顺利装好固然不错,但如果无法运行的话,又有什么用呢?</p><p>通常有两种启动X11的方式(然后就是 Fluxbox)。传统方法是使用<tt class="filename"> startx </tt> 命令。另一种方法是使用图形登录管理器(也称为“显示管理器”)。 最常见的显示管理器是<tt class="filename"> xdm </tt>,它是XFree86发行版中的一部分。 Gnome提供的显示管理器称为<tt class="filename"> gdm </tt>,KDE提供的则名为<tt class="filename"> kdm </tt>。</p><p>如果是用前一种方法(通过<tt class="filename"> startx </tt>)启动 X11, 那么有个非常重要的文件值得关注,就是 位于您主目录下的<tt class="filename"> .xinitrc</tt>。利用显示管理器来启动 X11 的话,您就得留意<tt class="filename"> .xsession</tt> 了,同样也是位于您的主目录下。</p><p>下一步就是要找到 Fluxbox 的可执行文件。对大多数人而言,都是/usr/local/bin/fluxbox。 现在,您需要编辑(或者创建)我在上一段所提到的那个文件了。就把下面这行语句添加到文件 最后面:</p><pre class="programlisting"> exec /usr/local/bin/fluxbox </pre><p>把<tt class="filename"> /usr/local/bin/fluxbox </tt>替换成您系统里Fluxbox可执行文件 实际所在的位置,从源代码编译的话,默认位置就是<tt class="filename"> /usr/local/bin/fluxbox</tt>。添加完后,保存您所做的修改并退出编辑器。如果您是用 <tt class="filename"> startx </tt>的话,请运行下面的命令:</p><pre class="programlisting"> $ chmod 700 .xinitrc </pre><p>如果使用<tt class="filename"> .xsession </tt>的话,上面这个步骤就不需要了。但不管您采用 哪种方法,都必须新创建一个目录,用来存放 Fluxbox 的配置文件:</p><pre class="programlisting"> $ mkdir .fluxbox </pre><p> 如果您漏掉了上面这一步,那么当您退出 Fluxbox 并重新启动的话,先前采用的设置就 全部丢失了(遗憾的是,系统无法自动创建此目录)。</p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2532958"></a>其它事项</h3></div></div><div></div></div><p>如果您需要帮助,直接到 Fluxbox 论坛上提出您的问题 就可以了,我相信一定会有人乐意解答的。 您也可以到邮件列表上提出您 的问题。在Fluxbox站点上有指向邮件列表的链接。最后一点, 我建议您把<tt class="filename"> /usr/local/share/fluxbox </tt> 目录下的<tt class="filename"> init </tt>,<tt class="filename">menu</tt>,和<tt class="filename"> titlebar </tt> 文件拷贝到您的主目录下的<tt class="filename"> .fluxbox/ </tt> 里。</p></div></div></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="id2524954"></a>章 3. 工具</h2></div></div><div></div></div><div class="toc"><p><b>目录</b></p><dl><dt><span class="sect1"><a href="#id2454686">简介</a></span></dt><dt><span class="sect1"><a href="#id2544922">fbrun</a></span></dt><dt><span class="sect1"><a href="#sect-fbgm">fluxbox-generate_menu</a></span></dt><dt><span class="sect1"><a href="#sect-fluxspace">fluxspace</a></span></dt><dt><span class="sect1"><a href="#sect-wmctrl">wmctrl</a></span></dt><dt><span class="sect1"><a href="#sect-pager">Pagers</a></span></dt></dl></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2454686"></a>简介</h2></div></div><div></div></div><p>Fluxbox 搭配使用的一些小工具提供了一些俏皮功能,也可以让您 用起 Fluxbox 更顺手。默认情况下,它们是和<tt class="filename"> fluxbox </tt>程序 安装在同一个目录下的,一般都是<tt class="filename">/usr/local/bin</tt>, 如果在安装配置时你选择的是别的路径前缀。大多数发行版使用的也不是上述默认位置,所以 您如果是从二进制软件包安装的话,可能会在<tt class="filename">/usr/bin </tt>里找到它们。</p></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2544922"></a><tt class="filename">fbrun</tt></h2></div></div><div></div></div><p><tt class="filename">fbrun </tt>基本上和其他桌面环境中的“Run...”对话框是一样 的功能。这是一个用来启动未在菜单项里出现的(或需要调用特殊参数)程序的简便方法。</p><p><tt class="filename">fbrun</tt> 另外还可以从菜单中调用,由此自动载入一个事先设定好 的命令行来运行(当然这个命令行是可以编辑的)。比如说以 ssh 方式连接到一个名字很长的主机,而参数选项又不断 变化。在这种情况下,您可以在菜单中添加一个 fbrun 项,用以包含所需的主机名和全部参数选项。 当用到上述项时,做些必要的修改然后运行就可以了。</p><p><tt class="filename">fbrun </tt>有多个选项:</p><pre class="programlisting"> -font [font name] 文本字体 -title [title name] 设定标题 -text [text] 文本输入 -w [width] 以像素计的窗口宽度 -h [height] 以像素计的窗口高度 -display [display string] Display名称 -pos [x] [y] 以像素计的窗口位置 -fg [color name] 文本的前景色 -bg [color name] 背景色 -a 开启反锯齿 -hf [history file] 历史文件载入(默认是 ~/.fluxbox/history) -help 显示帮助信息 </pre><p>大多数选项的用法应该是不言自明的。<b class="userinput"><tt>-text</tt></b> 和 <b class="userinput"><tt>-hf</tt></b> 选项也许还要说明一下。前者用于指定<tt class="filename"> fbrun </tt>窗口中预先载入的文字。如果您想指定多个 参数(像<b class="userinput"><tt> ssh -X -f </tt></b>),别忘了给它们套上双引号:</p><pre class="programlisting"> fbrun -text "ssh -X -f" </pre><p><b class="userinput"><tt>-hf</tt></b> 选项用来指定历史文件 -一个<tt class="filename">fbrun</tt> 存放您用过的命令行 的地方(就像 bash 所做的)。正常情况下您不需要这个选现,用默认值就可以了。我们建议您在菜单中使用多个 <tt class="filename">fbrun</tt> 项,然后为每一项配一个历史文件。</p></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect-fbgm"></a>fluxbox-generate_menu</h2></div></div><div></div></div><p>FIXME:本节有待完成。</p></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect-fluxspace"></a>fluxspace</h2></div></div><div></div></div><p>(摘自:<a href="http://fluxspace.sourceforge.net" target="_top">http://fluxspace.sourceforge.net</a>): </p><div class="blockquote"><blockquote class="blockquote"><p> Fluxspace 在 Fluxbox 已有的窗口管理功能上又融合了桌面管理的能力。它利用已有的组件和强大的 Python 语言来为 Fluxbox 及其它轻量级的窗口管理器打造一个灵活的桌面环境。 </p><div class="itemizedlist"><ul type="disc"><li><p>通过集成 Rox Filer 和 Idesk 工具,为 Fluxbox 中的每个 workspace 定制各自的图标和面板。</p></li><li><p>用不同的壁纸去装点每个 workspace。</p></li><li><p>管理您的启动程序。</p></li><li><p>在您进入和离开 workspaces 时自动运行和终止 applets,允许每一个 workspace 有自己特定的工具和 dockapps。</p></li></ul></div></blockquote></div></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect-wmctrl"></a>wmctrl</h2></div></div><div></div></div><p><a href="http://http://sweb.cz/tripie/utils/wmctrl/" target="_top">http://http://sweb.cz/tripie/utils/wmctrl/</a> </p><p> wmctrl 程序是一个和 EWMH/NetWM 兼容的 X 窗口管理器交互的命令行工具。 </p></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="sect-pager"></a>Pagers</h2></div></div><div></div></div><p> Pager 可以辅助管理多个 workspace 环境。诸如以缩略图的方式显示 workspace, 并在其中完成窗口的拖放。但与多个 workspace 打交道时,并非一定要用 paper,窗口管理器一样可以胜任,比方说 workspace 名称 和内容可以在工具栏上看到;通过窗口菜单或配置 apps 文件将窗口传送到其他 workspace 中去。</p><p> 但是借由 pager,我们的选择余地更大,比如显示窗口的边框,其他窗口内容的画面,或者正在运行中的程序的图标。 </p><div class="itemizedlist"><ul type="disc"><li><p>bbpager: blackbox 的 paper,配置风格类似,只能显示窗口的边框。 <a href="http://bbtools.sourceforge.net/" target="_top">bbtools</a> </p></li><li><p>fluxter: bbpager 的改进版, 配置方式接近于 fluxbox。 <a href="http://benedict.isomedia.com/homes/stevencooper/projects/fluxter.html" target="_top">fluxter</a> </p></li><li><p>Rox pager: ROX 桌面环境的 pager。 <a href="http://rox.sourceforge.net/" target="_top">ROX</a> </p></li><li><p>3d-Desktop: 用3D方式显示 workspace 的 OpenGL pager。 <a href="http://desk3d.sourceforge.net/" target="_top">desk3d</a> </p></li><li><p>还有很多 ... </p></li></ul></div><p> </p></div></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="chap-tabs"></a>章 4. 标签</h2></div></div><div></div></div><div class="toc"><p><b>目录</b></p><dl><dt><span class="sect1"><a href="#id2250715">标签入门</a></span></dt><dt><span class="sect1"><a href="#id2521075">标签的高级话题</a></span></dt><dd><dl><dt><span class="sect2"><a href="#id2521079">Sloppy Window Grouping</a></span></dt><dt><span class="sect2"><a href="#id2521099">Tabbing single window classes</a></span></dt><dt><span class="sect2"><a href="#id2517407">完全禁用标签</a></span></dt><dt><span class="sect2"><a href="#id2528059">Tab Placement</a></span></dt><dt><span class="sect2"><a href="#id2528082">Tab Autogrouping</a></span></dt><dt><span class="sect2"><a href="#id2540960">主题中的标签</a></span></dt></dl></dd></dl></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2250715"></a>标签入门</h2></div></div><div></div></div><p> Fluxbox 的标签并不是什么新玩意儿。它的实现方式 和 PWM Window Manager 中的标签非常相似。它的工作方式无非就是: 将多个窗口组合到一起,共享相同的几何性质 - 大小相同,位置也一模一样,移动其中一个 窗口导致所有窗口都一起移动。假想有一叠报纸,标签就像是插在报纸中塑料突起物,您可以借助它 轻松而迅速的翻到某一页。</p><p>在 0.1.14 版本以前,标签是贴在窗口上的,自 0.9.x 版本起,标签已嵌入到 窗口的标题栏中了。</p><p>Fluxbox 中的标签就是这么回事。只需简单的选择您要的窗口的标签,那个窗口 就会弹到所有窗口的最上面。在我们来试试。</p><h3><a name="id2520767"></a>基本的标签操作</h3><p>要记住的第一点是<span class="emphasis"><em>所有的</em></span>标签操作都要借助于鼠标的第三键。 首先,挑选两个您想组合到一起的窗口。在第一个窗口的标签上单击第三键,然后拖到第二个窗口的 标签上去。恭喜,这样它们就粘合到一起了!现在您可以用标签来完成窗口间的切换了。</p><p> 要移除标签的话,也是一样的做法。在组合的标签上单击第三键并把它拖走。</p></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2521075"></a>标签的高级话题</h2></div></div><div></div></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2521079"></a>Sloppy Window Grouping</h3></div></div><div></div></div><div class="blockquote"><blockquote class="blockquote"><p>"但我觉得想把标签拖到另一个小标签上去很不方便。"</p></blockquote></div><p>我们照样有好消息告诉您。在 Fluxbox 'configuration' 菜单中,选择 'Sloppy Window Grouping' 。这样您就可以把标签拖到目标窗口的任意位置来完成 窗口组合了。</p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2521099"></a>Tabbing single window classes</h3></div></div><div></div></div><div class="blockquote"><blockquote class="blockquote"><p>"好是好,但我只想给程序 X 贴上标签!"</p></blockquote></div><p>依据您想让多少程序有标签,用两种方法来完成这个工作。 您可以通过窗口来开启/关闭标签。(右键单击标题栏,选择 'tab' 项), <span class="emphasis"><em>或者</em></span> 您还可以通过 'Configuration'->'Use Tabs' 来关闭所有窗口的标签。关闭之后, 您可以再用刚才介绍的方法分别开启每个窗口的标签。</p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2517407"></a>完全禁用标签</h3></div></div><div></div></div><div class="blockquote"><blockquote class="blockquote"><p>"我对标签不怎么感兴趣。我可以禁用它们吗?"</p></blockquote></div><p>当然可以了。从 Fluxbox 'Configuration' 菜单中选择 'Use Tabs'。因为它是一个切换选项,所以再选一次的话就会 开启标签功能。在 <tt class="filename">init</tt> 配置文件中也有相关的设置:</p><pre class="programlisting"> session.tabs: true </pre><p>禁用标签功能可以通过把 <b class="userinput"><tt>true</tt></b> 替换为 <b class="userinput"><tt>false</tt></b> 来完成。</p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2528059"></a>Tab Placement</h3></div></div><div></div></div><p>在 0.1.14 版本以前,标签实际上是贴在窗口上的,自 0.9.x 版本起,标签已嵌入到 窗口的标题栏中了。</p><p>(0.1.14) 有一个称为 'Tab Placement' 的菜单配置选项。这里是标签在窗口上所处的位置。 鉴于大部分选项是很直观的,所以唯一值得提及的是 'Relative' 选项。这些选项使得窗口上所有标签的总长度 等于窗口的长度。也就是说,如果窗口上只有一个标签,那它的长度就是窗口的长度。如果有两个标签,每一个的长度 就是窗口长度的一半。该选项让标签看起来不是那么碍眼,因而倍受欢迎。</p></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2528082"></a>Tab Autogrouping</h3></div></div><div></div></div><p>有时您希望一些程序在启动时能够自动组合到一起。 自然而然地我们称之为“自动组合”。这部分内容将会解释它的工作原理。 首先,您需要 0.1.11 以上的 Fluxbox 版本。在之前的版本中,没有“自动组合” 这个功能。接着您需要创建一个 <tt class="filename">~/.fluxbox/groups</tt> 文件(如果不存在的话)。然后,编辑 <tt class="filename">~/.fluxbox/init</tt> 文件,加上这一行(如果已有但却 不一样的话就改成此行):</p><pre class="programlisting"> session.groupFile: ~/.fluxbox/groups </pre><p> Okay,各就各位了。现在您要做的就只是填入组合文件了。</p><h3><a name="id2513314"></a>组合文件的格式</h3><p>该文件中每一行对应一个组合,您只用加入要组合到一起的程序的名称就可以了。例如:</p><div class="example"><a name="id2513324"></a><p class="title"><b>例子 4.1. <tt class="filename">groups</tt> file</b></p><pre class="programlisting"> Navigator nedit xterm </pre></div><p>以上将构造出两个组合,一个是 <tt class="filename">netscape</tt> 和 <tt class="filename">nedit</tt> 的组合,另一个是 <tt class="filename">xterm</tt> 单独构成的一个组合。新建立的窗口只能和同一个 workspace 里的 窗口以及焦点最后所处的那个窗口组合到一起。用下面的方法来获取程序名以便写入分组文件:</p><pre class="programlisting"> xprop |awk '/WM_CLASS/{print $4}' </pre><p>再点击窗口即可。如果没有任何显示,试着把 <b class="userinput"><tt>$4</tt></b> 改成 <b class="userinput"><tt>$3</tt></b>。</p><h3><a name="id2544971"></a>以标签来自动组合</h3><p>这种方式允许您弹出根菜单,当您右击标签并选择了一个应用程序之后,就可以开始组合到标签上了。</p><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">注</h3><p> 用这种方式组合 (从标签) 可能会与正常的自动组合产生严重的冲突。</p></div></div><div class="sect2" lang="zh_cn"><div class="titlepage"><div><div><h3 class="title"><a name="id2540960"></a>主题中的标签</h3></div></div><div></div></div><p>我们用了整整一节(<a href="#chap-themes" title="章 10. 主题">章 10, <i>主题</i></a>) 来介绍如何控制标签在主题中的外观。如果感兴趣您可以看一看。 (主题中的标签在默认情况下和标题栏的外观是相同的;只不过有时人们希望变化一下。)</p></div></div></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="id2540314"></a>章 5. 按键绑定</h2></div></div><div></div></div><div class="toc"><p><b>目录</b></p><dl><dt><span class="sect1"><a href="#id2540319">Keygrabber</a></span></dt><dt><span class="sect1"><a href="#id2522393">按键名称</a></span></dt><dt><span class="sect1"><a href="#id2539190">动作</a></span></dt></dl></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2540319"></a>Keygrabber</h2></div></div><div></div></div><p>keygrabber 的工作方式和 <tt class="filename">bbkeys</tt>(也是一个非常棒的工具, 但功能上有其局限性,过去采用了不兼容的许可证)非常相似,但配置文件采用了全新的语法,所具有 的一些新功能甚至让 Fluxbox 变得更加强大。</p><p>其中之一就是,新的 keygrabber 支持类似于 emacs 中的 keychains... 也就是说您可以用:<b class="userinput"><tt>Mod1 + M + Mod1 + F</tt></b> 切换至下一个 workspace (不是每个人在实际中都会采用这个按键序列啦)。</p><p>如果您已经敲入了某个按键序列的部分按键但是决定不再继续(即退出) 那么只需敲入别的按键序列(必须是已在 keys-file 中配置了的)即可退出(使用: AbortChain)。</p><p>除此之外您还可以通过按键序列的绑定在已分组/贴标签的一组窗口中进行切换 (使用:NextTab 和 PrevTab)。</p><p>最后,为了让您的便利我们(或者说就是 vlaad 和 tarzeau二人)还提供了两个脚本( 它们的作用相同)用于将 <tt class="filename">bbkeys</tt> 配置文件转换成 Fluxbox 的 keys-file。(这两个脚本的用法已在脚本中予以描述)。 Download: <a href="http://fluxbox.sourceforge.net/download/convertkeys" target="_top">convertkeys</a> or <a href="http://fluxbox.sourceforge.net/download/convertkeys2" target="_top">convertkeys2</a>.</p><div class="example"><a name="id2524682"></a><p class="title"><b>例子 5.1. Fluxbox keysfile</b></p><pre class="programlisting"> Mod1 Tab :NextWindow Mod1 F1 :Workspace 1 Mod1 F2 :Workspace 2 Mod1 F3 :Workspace 3 Mod1 F4 :Workspace 4 Control n Mod1 n :NextTab </pre></div><p>就像您看到的那样,首先是一个修饰符,然后是一个按键 (如果您想要更长的按键序列就接着跟上修饰符和按键) 最后是一个分号跟上一个动作。</p><p>欲知合法的按键动作的详细情况请继续阅读此文档。</p><p>以上所讲的对您有什么用处呢?现在您就可以完全控制您的 xmms 了,例如:</p><div class="example"><a name="id2522362"></a><p class="title"><b>例子 5.2. XMMS 按键绑定</b></p><pre class="programlisting"> Mod1 P :ExecCommand xmms -p Mod1 F :ExecCommand xmms -f </pre></div><p>如果您有一些附加的按键(例如多媒体键)的话,就可以通过这种方式来控制 xmms,但前提是 已在 XFree86 中正确配置了这些按键:</p><div class="example"><a name="id2522377"></a><p class="title"><b>例子 5.3. Multimedia keys for XMMS</b></p><pre class="programlisting"> None XF86AudioPlay :ExecCommand xmms -u None XF86AudioStop :ExecCommand xmms -s </pre></div><p>我想说的是详细情况最好参见 xmms --help,但您现在应该完成得非常不错了...</p></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2522393"></a>按键名称</h2></div></div><div></div></div><p>您或许在问自己怎样才能找出每个按键的名称。运行 <tt class="filename">xev</tt>,将鼠标移动到新创建的 窗口上,在键盘上随便按一个键,看看 xev 是怎么说的。这里有个例子说明的是按下右箭头键后的情况: </p><div class="example"><a name="id2522408"></a><p class="title"><b>例子 5.4. 按下右箭头键后 <tt class="filename">xev</tt> 的输出</b></p><pre class="screen"> KeyPress event, serial 18, synthetic NO, window 0x2c00001, root 0x60, subw 0x0, time 3745737930, (373,380), root:(504,526), state 0x10, keycode 102 (keysym 0xff53, Right), same_screen YES, XLookupString gives 0 characters: "" </pre></div><p>我们感兴趣的是按键的名称,也就是在括号中和 <tt class="computeroutput">keysym</tt> 一起列出的 内容。在此例中,位于 <tt class="computeroutput">(keysym 0xff53, Right)</tt>中。所以,对应的按键名称即 <tt class="computeroutput">Right</tt>。</p><h2><a name="id2539132"></a>特殊按键</h2><p>这里有些方便您的特殊按键。注意在按下这些键之后 <tt class="filename">xev</tt> 立即就会 显示出它们(而不是作为其它按键的修饰符)。</p><div class="informaltable"><table border="0"><colgroup><col><col></colgroup><thead><tr><th>Key</th><th>X11 Name</th></tr></thead><tbody><tr><td>Control, Strg</td><td>Control</td></tr><tr><td>Alt</td><td>Mod1</td></tr><tr><td>Super, Meta, Win* Keys</td><td>Mod4</td></tr></tbody></table></div></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2539190"></a>动作</h2></div></div><div></div></div><p>以下是 Fluxbox 所能提供的动作。它们基本上对应了用户大部分所能想到的按键。 要注意的是在按键绑定的配置文件中,位于动作前的最后一个字符应该是 <b class="userinput"><tt>:</tt></b>。</p><p>动作对于大小写是敏感的。</p><div class="table"><a name="id2524493"></a><p class="title"><b>表格 5.1. Navigation</b></p><table summary="Navigation" border="0"><colgroup><col><col></colgroup><thead><tr><th>Action</th><th>Result</th></tr></thead><tbody><tr><td><b class="userinput"><tt>Workspace</tt></b></td><td>Go to a particular workspace. Use :Workspace 1, :Workspace 2, etc.</td></tr><tr><td><b class="userinput"><tt>NextTab</tt></b></td><td>Switch to the Next Tab in the current group.</td></tr><tr><td><b class="userinput"><tt>PrevTab</tt></b></td><td>Switch to the Previous Tab in the current group.</td></tr><tr><td><b class="userinput"><tt>NextWindow N</tt></b></td><td>Go to Next Window. See <a href="#keys-note-1">Note 1</a>.</td></tr><tr><td><b class="userinput"><tt>PrevWindow N</tt></b></td><td>Go to previous window. Again, see <a href="#keys-note-1">Note 1</a>.</td></tr><tr><td><b class="userinput"><tt>NextWorkspace</tt></b></td><td>Go to the Next Workspace.</td></tr><tr><td><b class="userinput"><tt>PrevWorkspace</tt></b></td><td>Go to the Previous Workspace.</td></tr><tr><td><b class="userinput"><tt>NextGroup</tt></b>, <b class="userinput"><tt>PrevGroup</tt></b></td><td>Go to the next/prev window group.</td></tr><tr><td><b class="userinput"><tt>LeftWorkspace</tt></b></td><td>Same as PrevWorkspace.</td></tr><tr><td><b class="userinput"><tt>RightWorkspace</tt></b></td><td>Same as NextWorkspace.</td></tr></tbody></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a name="keys-note-1"></a>1. NextWindow / PrevWindow</h3><p><b class="userinput"><tt>NextWindow</tt></b>/<b class="userinput"><tt>PrevWindow</tt></b> 有很多参数,想在上面这张表中全部都解释有点不太现实。这里只是它的基本工作原理。</p><p>用于配置行为的整数参数:</p><div class="informaltable"><table border="0"><colgroup><col><col></colgroup><thead><tr><th>Parameter value</th><th>Behaviour</th></tr></thead><tbody><tr><td>0 or unspecified</td><td>Default/current behavior - no skipping</td></tr><tr><td>1</td><td>Skip lower tabs</td></tr><tr><td>2</td><td>Skip stuck windows</td></tr><tr><td>3</td><td>Skip lower tabs/stuck windows</td></tr><tr><td>4</td><td>Skip shaded windows</td></tr><tr><td>5</td><td>Skip lower tabs/shaded windows</td></tr><tr><td>6</td><td>Skip stuck windows/shaded windows</td></tr><tr><td>7</td><td>Skip lower tabs/stuck windows/shaded windows</td></tr></tbody></table></div></div><div class="table"><a name="id2524599"></a><p class="title"><b>表格 5.2. Window Operations</b></p><table summary="Window Operations" border="0"><colgroup><col><col></colgroup><thead><tr><th>Action</th><th>Result</th></tr></thead><tbody><tr><td><b class="userinput"><tt>Close</tt></b></td><td>Close the Window.</td></tr><tr><td><b class="userinput"><tt>KillWindow</tt></b></td><td>The equivalent of calling <tt class="filename">xkill</tt> and clicking on the window.</td></tr><tr><td><b class="userinput"><tt>Minimize</tt></b></td><td>Also known as "iconify". Make the window iconified.</td></tr><tr><td><b class="userinput"><tt>ShadeWindow</tt></b></td><td>Put window in the 'shaded' state, or restore from the 'shaded' state.</td></tr><tr><td><b class="userinput"><tt>StickWindow</tt></b></td><td>Toggle a Window's 'sticky' state.</td></tr><tr><td><b class="userinput"><tt>ToggleDecor</tt></b></td><td>Toggle whether or not current window has a border, buttons, and titlebar.</td></tr><tr><td><b class="userinput"><tt>Raise</tt></b></td><td>Bring the window to the 'Top', it will appear 'Above' windows that it overlaps.</td></tr><tr><td><b class="userinput"><tt>Lower</tt></b></td><td>Opposite of Raise.</td></tr><tr><td><b class="userinput"><tt>NextTab</tt></b>, <b class="userinput"><tt>PrevTab</tt></b></td><td>Activate next, prev tab.</td></tr><tr><td><b class="userinput"><tt>MoveTabLeft</tt></b>, <b class="userinput"><tt>MoveTabRight</tt></b></td><td>Move activate tab by the <b class="userinput"><tt>n</tt></b> tabs left/right.</td></tr><tr><td><b class="userinput"><tt>DetachClient</tt></b></td><td>Take client out of tab-group.</td></tr></tbody></table></div><div class="table"><a name="id2524974"></a><p class="title"><b>表格 5.3. Window Sizing</b></p><table summary="Window Sizing" border="0"><colgroup><col><col></colgroup><thead><tr><th>Action</th><th>Result</th></tr></thead><tbody><tr><td><b class="userinput"><tt>MaximizeHorizontal</tt></b></td><td>Maximize the window horizontally.</td></tr><tr><td><b class="userinput"><tt>MaximizeVertical</tt></b></td><td>Maximize the window vertically.</td></tr><tr><td><b class="userinput"><tt>MaximizeWindow</tt></b></td><td>Maximize the Window.</td></tr><tr><td><b class="userinput"><tt>Resize</tt></b></td><td>Resize the active window by the specified delta, e.g. <b class="userinput"><tt>resize -8 -8</tt></b>.</td></tr><tr><td><b class="userinput"><tt>ResizeTo</tt></b></td><td>Resize the active window to the specified geometry. <b class="userinput"><tt>resize -8 -8</tt></b>.</td></tr><tr><td><b class="userinput"><tt>ResizeHorizontal</tt></b></td><td>Resize horizontal by the specified delta.</td></tr><tr><td><b class="userinput"><tt>ResizeVertical</tt></b></td><td>Resize vertical by the specified delta.</td></tr><tr><td><b class="userinput"><tt>ArrangeWindows</tt></b></td><td>Tile Windows magically.</td></tr><tr><td><b class="userinput"><tt>ShowDesktop</tt></b></td><td>Iconify all windows.</td></tr></tbody></table></div><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title"><a name="keys-note-resize-unit"></a>注</h3><p>在缩放的时候,"one unit" 对于不同的应用程序可能意义有所不同。 <tt class="filename">xterm</tt>/<tt class="filename">aterm</tt>/<tt class="filename">Eterm</tt> 会增加额外一个字符宽的空间,而不是以像素为单位缩放。</p><p>其它的程序应该都是以像素为单位进行缩放。</p></div><div class="table"><a name="id2525238"></a><p class="title"><b>表格 5.4. 窗口移动</b></p><table summary="窗口移动" border="0"><colgroup><col><col></colgroup><thead><tr><th>Action</th><th>Result</th></tr></thead><tbody><tr><td><b class="userinput"><tt>SendToWorkspace</tt></b></td><td>Send current window to a specified workspace. Use :SendToWorkspace 1</td></tr><tr><td><b class="userinput"><tt>Move</tt></b></td><td>by delta-x delta-y.</td></tr><tr><td><b class="userinput"><tt>MoveLeft</tt></b></td><td>Guess.</td></tr><tr><td><b class="userinput"><tt>MoveRight</tt></b></td><td>Guess.</td></tr><tr><td><b class="userinput"><tt>MoveUp</tt></b></td><td>Guess.</td></tr><tr><td><b class="userinput"><tt>MoveDown</tt></b></td><td>Guess.</td></tr></tbody></table></div><div class="table"><a name="id2537438"></a><p class="title"><b>表格 5.5. 杂项</b></p><table summary="杂项" border="0"><colgroup><col><col></colgroup><thead><tr><th>Action</th><th>Result</th></tr></thead><tbody><tr><td><b class="userinput"><tt>AbortKeychain</tt></b></td><td>In Multi-binding keychains, cancel the keybinding.</td></tr><tr><td><b class="userinput"><tt>ExecCommand</tt></b></td><td>Execute a command. Example :ExecCommand xmms -t.</td></tr><tr><td><b class="userinput"><tt>RootMenu</tt></b></td><td>Summon the Root Menu.</td></tr><tr><td><b class="userinput"><tt>WorkSpaceMenu</tt></b></td><td>Summon the Workspace Menu.</td></tr><tr><td><b class="userinput"><tt>Restart</tt></b></td><td>Restart fluxbox.</td></tr><tr><td><b class="userinput"><tt>Reconfigure</tt></b></td><td>Reconfigure fluxbox, rereads configuration. e.g. if <tt class="filename">keys</tt> was changed, but <tt class="filename">init</tt> and <tt class="filename">slitlist</tt> might be written before read.</td></tr><tr><td><b class="userinput"><tt>SetStyle</tt></b></td><td>Load the specified file.</td></tr><tr><td><b class="userinput"><tt>SetWorkspaceName</tt></b></td><td>.</td></tr><tr><td><b class="userinput"><tt>SaveRC</tt></b></td><td>Save resource files.</td></tr><tr><td><b class="userinput"><tt>Quit</tt></b></td><td>Quit fluxbox.</td></tr></tbody></table></div></div></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="chap-bg"></a>章 6. 桌面背景</h2></div></div><div></div></div><p> 像 Blackbox 一样,Fluxbox 为此也提供了两套 wrapper 工具--<tt class="filename">bsetroot </tt> 和<tt class="filename"> fbsetbg </tt>。 我们一道来看看它们是如何工作的。</p><p><tt class="filename">bsetroot </tt>几乎具备了<tt class="filename">xsetroot</tt>的所有功能。 只要是简单的背景它都可以设置, 例如单色的。另外,<tt class="filename">bsetroot</tt> 也可以设置渐变色的背景。</p><p><tt class="filename">fbsetbg </tt>之所以称为 wrapper,在于它尝试着去寻找 一个适合的背景设置程序,从而间接完成背景的设置。您不需要对<tt class="filename"> fbsetbg </tt>进行配置。 它会自动采用最先找到的程序。 </p><h2><a name="id2478866"></a>覆盖主题背景</h2><p>Fluxbox允许您忽略 style 文件中指定的背景而另在您的 <tt class="filename">~/.fluxbox/init </tt>文件:</p>中指定: <pre class="programlisting"> session.screen0.rootCommand: fbsetbg -f ~/backgrounds/zimdib_dark.png </pre><p>为避免对<tt class="filename"> ~/.fluxbox/init </tt>文件进行不必要的改动, <tt class="filename">fbsetbg </tt> 会将刚用过的壁纸保存在<tt class="filename"> ~/.fluxbox/lastwallpaper </tt> 里,然后在用<b class="userinput"><tt>-l</tt></b>选项的时候再重新载入此壁纸。rootCommand 应该是这样子 </p><pre class="programlisting"> session.screen0.rootCommand: fbsetbg -l </pre></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="chap-slit"></a>章 7. Slit</h2></div></div><div></div></div><p>一直有人在问,“slit 是什么?”其实,当撰写此文档时,我就已经 把这个问题放到了 FAQ 的开头,并建议大家认真的阅读本节,以免在#fluxbox 频道上 再出现那种类似的问题每天不下十次的被问到的情形,或者是再将 slit 和工具栏 两个概念混为一谈。</p><p>Fluxbox 从 Blackbox 那儿继承了很多东西,slit 也是其中之一。 它是专门用来安放 WindowMaker Dockapps 的,(以及其余能够运行于“withdrawn”或 “swallowed”(较少出现)模式的程序)。这些应用程序一般都有<b class="userinput"><tt> -w </tt></b> 选项,但有些是自动处于 withdrawn 模式的。</p><p>首先要确保这项功能已经编译进了你的 Fluxbox。通常情况下你可以放心的当做事实的确如此。 据我所知,针对各个发行版的 Fluxbox 软件包都附带有这项功能。如果你认为自己还是不要它为妙的话,大可以在编译时禁用掉。 但我要强调的是,一个空闲的 slit 不会占用<span class="emphasis"><em>任何</em></span> 屏幕空间,同时也只仅需要一点点内存, 所以除非它和您系统上的其它程序发生了冲突, 否则我认为并没有什么理由禁用它。</p><p>除此之外,您可以运行任意一个“dockable”程序。 (这也称为运行于“withdrawn”模式)。举例来说,<tt class="filename">xmms </tt>安装时就 附带着<tt class="filename"> wmxmms </tt>这个程序。运行<b class="userinput"><tt>wmxmms &</tt></b>,xmms 就会出现在 slit 里了。 上面已经提到过,有些应用程序(例如<tt class="filename"> gkrellm </tt>)需要开启<b class="userinput"><tt> -w </tt></b> 命令行开关才能在 slit 中出现。</p><h2><a name="id2541162"></a>我到哪儿去找 dockapps ?</h2><p>起步的最好地方当然是<a href="http://www.bensinclair.com/dockapp" target="_top"> Dockapp warehouse </a>了。那里几乎就是 dockapps 的大仓库,各种门类应有尽有。 另外,您还可以在<a href="http://freshmeat.net/" target="_top"> Freshmeat </a> 站点上搜索,或者检查您的发行版。</p><p><a href="http://bbtools.sourceforge.net" target="_top">bbtools </a> 页面上也有不少 Blackbox/Fluxbox 工具,其中大多数都是可以在 slit 中运行的。</p><p>同样地,如果您启用了KDE支持,KDE dock applets 也会在 slit 中看到的。</p><p><a href="http://www.dockapps.org/" target="_top">Dockapps.Org </a> 则是一个专门讨论dockapps的新站点。</p><h2><a name="id2556474"></a>我可以改变 slit 的行为吗?</h2><p>当然可以啦。只要鼠标右键单击 slit 的可视区域,然后点选弹出的选项就可以了。 大多数弹出选项和任务栏上的是一模一样的。唯一不同的是,slit 多了一个 <tt class="computeroutput"> Direction </tt>选项。因为您的 slit 可以运行于 <tt class="computeroutput"> Horizontal </tt>或 <tt class="computeroutput"> Vertical </tt>方式。</p><p>在 configure 菜单中还有个<b class="userinput"><tt> Maximize Over Slit </tt></b> 选项,可以让最大化的窗口盖住 slit。</p><h2><a name="id2556504"></a>我想让我的 slit 程序记住它们的顺序!</h2><p>从 Fluxbox 0.1.10 开始,这不再是奢望,利用<tt class="filename"> slitlist</tt> 文件 就可以实现。 这里是一些用法指导。</p><p>dockapps的当前摆放顺序是由一个配置文件控制的,默认情况下是 <tt class="filename">~/.fluxbox/slitlist</tt>。在把 dockapps 载入到 slit 的过程中,该文件试图维持原先的摆放顺序,按照名称和原先的 dockapps 进行匹配。</p><p>想按照您喜欢的顺序进行安排的话,这里有个很简单的方法:</p><div class="procedure"><p class="title"><b>过程 7.1. dockapps 排序</b></p><ol type="1"><li><p>在不预先载入任何 dockapps 的情况下运行 Fluxbox。</p></li><li><p>按照您希望的顺序一个一个的运行 dockapps。</p></li><li><p>把这些 dockapps 添加到您的自动启动脚本里,例如 <tt class="filename">.xinitrc</tt> 或者 <tt class="filename">.xsession</tt>。 顺序在这里就无关紧要了。</p></li></ol></div><p>默认情况下摆放顺序保存在<tt class="filename"> ~/.fluxbox/slitlist </tt>文件里,并且在以后的 Fluxbox 会话中 也将继续维持这个顺序不变。</p><p>您可以自由的手动编辑<tt class="filename"> slitlist</tt> 文件。它列出了 一系列窗口的名称,每行对应一个 dockapp。您应该在关闭Fluxbox的时候再编辑 此文件,否则刚刚做出的改动随时都有可能被覆盖掉。</p><p>您也可以选择别的文件路径来作为 slit list。下面这个例子中的<tt class="filename"> init </tt>就对默认路径 做了调整:</p><div class="example"><a name="id2524449"></a><p class="title"><b>例子 7.1. 指定 Slitlist </b></p><pre class="programlisting"> session.slitlistFile: /home/me/etc/slitsort </pre></div><p>注意,您是无论如何也找不到哪个选项用来彻底禁用排序的。 在补丁制作者看来,随心所欲的乱堆乱放一点好处都没有!</p></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="chap-toolbar"></a>章 8. 工具栏</h2></div></div><div></div></div><p>工具栏是 Fluxbox 用来显示信息的一块小区域,比如时钟啦,或者代表要运行的程序的按钮。</p><p>它由 init 和 style 文件负责配置。Init 中的设置一般可以经由工具栏菜单予以改变。</p><p>通过设置 init 文件里的<tt class="computeroutput"> session.screen0.toolbar.visible: false </tt>这一行,您可以关闭 工具栏(也就是让其不可见)。</p><p>显示哪些工具是由资源文件(通常是 .fluxbox/init 中的 toolbar.tools 这一条)负责配置的, </p><div class="example"><a name="id2467524"></a><p class="title"><b>例子 8.1. 工具栏的工具示例</b></p><pre class="programlisting"> session.screen0.toolbar.tools: clock, iconbar, workspacename </pre></div><p> 可能用到的工具:workspacename,prevworkspace,nextworkspace,iconbar, systemtray,prevwindow,nextwindow,clock </p><p>工具栏的宽度,透明度以及层次皆可通过工具栏的菜单予以配置。在工具栏中的时钟或工作区名上 右键单击均可以弹出工具栏菜单。</p><p>通过配置,可以在图标栏中显示下述功能项之一:None,Icons from all workspaces,Workspace Icons, all windows from Workspace,All Windows from all workspaces</p><p>它的显示方式由style文件负责配置。</p></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="id2537269"></a>章 9. 菜单编辑</h2></div></div><div></div></div><div class="toc"><p><b>目录</b></p><dl><dt><span class="sect1"><a href="#id2541978">设置菜单文件位置</a></span></dt><dt><span class="sect1"><a href="#id2542014">可用的命令</a></span></dt></dl></div><p>装好 Fluxbox 后,在桌面上右击鼠标键后您就 可以看到那个称为“菜单”的程序启动器了。如果不能通过编辑它而启动您的 程序的话就没毫无用处了。这一节试图回答所有与此相关的问题。</p><p>先说明一下,Fluxbox 附带了一个很棒的工具,叫做<tt class="filename"> fluxbox-generate_menu </tt>。 它试着找出系统中已安装的常见程序(如浏览器,终端模拟器等)的执行路径,然后再构造一个 菜单文件。<tt class="filename">fluxbox-generate_menu </tt>在<a href="#sect-fbgm" title="fluxbox-generate_menu">"fluxbox-generate_menu"</a>中有详述。</p><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2541978"></a>设置菜单文件位置</h2></div></div><div></div></div><p>默认情况下 Fluxbox 菜单位于<tt class="filename"> ~/.fluxbox/menu</tt>。但 这个配置可以通过您的<tt class="filename"> init </tt>文件加以修改。这里有一个示例:</p><div class="example"><a name="id2541994"></a><p class="title"><b>例子 9.1. 设置菜单文件</b></p><pre class="programlisting"> session.menuFile: ~/.fluxbox/menu </pre></div><p>如果您希望采用别的文件作为菜单文件,只需修改<tt class="filename"> ~/.fluxbox/menu </tt>即可。但默认的配置应该符合大多数人的口味。</p></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2542014"></a>可用的命令</h2></div></div><div></div></div><p>Fluxbox 菜单文件是一个普通的文本文件。您可以通过它来构造 subfolders, 启动程序,控制 workspaces,配置 Fluxbox 和退出 X。它采用的命令如下所示:</p><pre class="programlisting"> # menu file 2004-06-22 [begin] (MenuTitle) [submenu] (SubMenuName) {SubMenuTitle} [exec] (ApplicationName) {/path/to/program} [include] (/path/to/menufile) <icon file> [end] [nop] (--------) [workspaces] (SubMenuName) [stylesdir] (/path/to/stylesdir) [config] (FluxboxConfiguration) [reconfigure] (Reconfigure) [restart] (Restart) [exit] (Exit) </pre><p> </p><div class="itemizedlist"><ul type="disc"><li><p>注释以<b class="userinput"><tt> # </tt></b>起头,到行末的所有字符都将忽略。</p></li><li><p><b class="userinput"><tt>[]</tt></b>中的文字是 fluxbox 执行的命令。</p></li><li><p><b class="userinput"><tt>()</tt></b>中的文字是菜单上显示的文字。</p></li><li><p><b class="userinput"><tt>{}</tt></b>中的文字是此项如果点选后启动的程序。</p></li><li><p><b class="userinput"><tt><> </tt></b>中指定了一个图标文件。它必须是一个绝对路径且为 xpm 格式。</p></li><li><p>要包含指令的那个参数如果是目录的话,目录里的每个文件就都会包含进去。</p><p>被包含的文件必须以<b class="userinput"><tt>[begin]</tt></b>开头,以<b class="userinput"><tt>[end]</tt></b>结尾。</p></li></ul></div><p> 以上的所有项不是在任何情况下都需要的,比如<b class="userinput"><tt>[end]</tt></b>对图标而言就没有任何意义。 </p><p>注意子菜单的嵌套深度并没有一个硬性限定。但实际使用时可能会有。</p><p><b class="userinput"><tt>[nop]</tt></b> - 如果不想执行任何命令而只是作为菜单中的一个分隔 项的话,您可以用它来填入文字或空行。</p><p><b class="userinput"><tt>[reconfigure]</tt></b> - 如果您用菜单来更改 Fluxbox 的配置, 在退出 Fluxbox 之后,所做出的更改就自动失效了。必须写到They need to be written to the <tt class="filename"> init </tt>文件里才能让更改固定下来,您可以在更改配置后再点击 reconfigure 来 达到这个目的。</p><p><b class="userinput"><tt>[restart]</tt></b> - 我只想确保人人都知道,restart 只是重启 Fluxbox,而不是整个系统。</p><div class="example"><a name="id2488978"></a><p class="title"><b>例子 9.2. <tt class="filename">菜单文件</tt></b></p><pre class="programlisting"> # Fluxbox menu file [begin] (Fluxbox) [exec] (rxvt) {rxvt -ls} [exec] (netscape) {netscape -install} [exec] (The GIMP) {gimp} [exec] (XV) {xv} [exec] (Vim) {rxvt -geometry 132x60 -name VIM -e screen vim} [exec] (Mutt) {rxvt -name mutt -e mutt} [submenu] (mozilla) [exec] (browser) {mozilla -browser} [exec] (news) {mozilla -news} [exec] (mail) {mozilla -mail} [exec] (edit) {mozilla -edit} [exec] (compose) {mozilla -compose} [end] [submenu] (Startup) [exec] (gkrellm) {gkrellm -w} [exec] (xmms) {xmms -p} [exec] (galeon) {galeon -s} [exec] (kdeinit) {kdeinit} [end] [submenu] (Window Manager) [exec] (Edit Menus) {nedit ~/.fluxbox/menu} [submenu] (Style) {Which Style?} [stylesdir] (~/.fluxbox/styles) [stylesmenu] (Fluxbox Styles) {/usr/local/share/fluxbox/styles} [end] [config] (Config Options) [reconfig] (Reconfigure) [restart] (Restart) [end] [exit] (Log Out) [end] # end of menu file </pre></div><p>完整的配置请查阅 Fluxbox 附带的<tt class="filename"> menu </tt> 文件样本。</p></div></div><div class="chapter" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="chap-themes"></a>章 10. 主题</h2></div></div><div></div></div><div class="toc"><p><b>目录</b></p><dl><dt><span class="sect1"><a href="#id2537184">主题的入门</a></span></dt><dt><span class="sect1"><a href="#id2543471">主题的高阶编辑</a></span></dt></dl></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2537184"></a>主题的入门</h2></div></div><div></div></div><p>本节由 <a href="mailto:rebelo@shaw.ca" target="_top">Justin Rebelo</a> aka "demerol" 贡献。</p><h2><a name="id2537279"></a>style 是什么以及它的工作原理?</h2><p>style 主要就是指 Fluxbox 的主题。它其实就是一个简单的 ASCII 文本文件,用来指示 Fluxbox 来如何生成窗口管理器各个组件的外观的。 它们通常位于 <tt class="filename">~/.fluxbox/styles</tt> 和 Fluxbox 的全局共享目录下, 至于具体位置,要依据您是如何安装 Fluxbox 而定了。</p><h2><a name="id2537298"></a>我自己该怎么制作主题?</h2><p>用您最拿手的文本编辑器打开一个 style (我推荐 <tt class="filename">vim</tt>),从这里起步。看看这个 style,它的结构是什么样子, 它是如何组织的。稍加观察,您所有的疑问差不多就都能得到解答了。</p><h2><a name="id2537315"></a>style 的构成</h2><p>style 由几个主要组件构成,每个组件又有自己独立的指令。其中, <b class="userinput"><tt>toolbar</tt></b>,<b class="userinput"><tt>menu</tt></b> 和 <b class="userinput"><tt>window</tt></b> 是 三个最主要的组件。<b class="userinput"><tt>window.*</tt></b> 指令用于控制窗口框架 的外观,<b class="userinput"><tt>window.tab.*</tt></b> 控制窗口标签的外观。<b class="userinput"><tt>menu.*</tt></b> 则控制您右击 桌面后弹出的菜单的外观。<b class="userinput"><tt>toolbar.*</tt></b> 是位于屏幕顶部或底部的那一栏。 如果您没有明确设置 Slit (在其他窗口管理器中也称为 dock,wharf 等等) 的 style,它也同样由 <b class="userinput"><tt>toolbar</tt></b> 来控制。</p><h2><a name="id2537361"></a>我该如何改变 slit 的外观呢?</h2><p>slit 通常和工具栏的 style 设置选项相同。大多数情况下这种方式运转的相当良好。 如果您要明确的设置 slit 的style,由三种 style 指令可供使用:</p><pre class="programlisting"> slit: [texture option] slit.color: [color value] slit.colorTo: [color value] </pre><p>这些命令的工作方式就像在菜单、窗口中那样,比如在给 Slit 配上纹理图案的时候。</p><h2><a name="id2543406"></a>我可以设置背景图案或颜色吗?</h2><p>在 style 文件的某处,您或许会发现有一行以 <b class="userinput"><tt>rootCommand</tt></b> 打头,然后紧接着是一个设置 style 背景颜色或图案的命令。 Fluxbox 中的 <tt class="filename">bsetroot</tt> 程序是专门用来设置颜色和渐变式背景,而 <tt class="filename">fbsetbg</tt> 则是专门 用于设置图像背景的。</p><h2><a name="id2543432"></a>我可以在我的 style 文件中添加注解/注释吗?</h2><p>当然可以啦,要注释的那一行用哈希(<b class="userinput"><tt>#</tt></b>)符号和一个感叹号(<b class="userinput"><tt>!</tt></b>)开头, 或者用 C++风格的注释方法(<b class="userinput"><tt>//</tt></b>)就可以了。</p><h2><a name="id2543456"></a>我还有更多的问题...</h2><p>瞧一下 Fluxbox 提供的 styles,您应该就能找到答案了,要么试试其他的设置。如果 还是还是摸不着北,到 OPN 上的#fluxbox 频道上来。我的昵称是 demerol。</p></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2543471"></a>主题的高阶编辑</h2></div></div><div></div></div><p>本节的大部分内容取自 Fluxbox 0.1.13版 manpage 内容,或深受其影响。 通常,manpage 就是这方面的绝对权威,但这一节或许对刚起步的 style 设计人员来说 更有启蒙价值吧。</p><p>要理解 style 的工作机制,有一点对 X11 中的“资源”概念的了解是很有裨益的。</p><p>X11 的资源由键和键值组成。键由更小的键组成 (有时称为子键),每个子键用点 (<b class="userinput"><tt>.</tt></b>) 隔开。键也可以 包含星号(<b class="userinput"><tt>*</tt></b>) 以作为通配符,意思是说已输入的某行文字将和多个键匹配。 在某些 styles 仅仅基于一或两种颜色的时候,这种方用法很有用。</p><p>Fluxbox 允许您对其三个主要组件进行配置: 工具栏,菜单,窗口修饰。slit 自动从工具栏继承了 style,但如果需要的话也可以另外设置。 拖拉窗口时用于显示坐标位置的小窗口,它的 style 则是从被拖拉窗口的标题栏那儿借来的。</p><p>这里有些容易上手的例子,说明了一些基本语法:</p><div class="example"><a name="id2528005"></a><p class="title"><b>例子 10.1. Toolbar Clock style</b></p><pre class="programlisting"> toolbar.clock.color: green </pre></div><p>这一项可将工具栏上时钟的“颜色”资源设置成 <b class="userinput"><tt>绿色</tt></b>。另一个例子:</p><div class="example"><a name="id2528023"></a><p class="title"><b>例子 10.2. Menu style</b></p><pre class="programlisting"> menu*color: rgb:3/4/5 </pre></div><p>这个则是将菜单及所有子菜单的颜色设置成 <b class="userinput"><tt>rgb:3/4/5</tt></b>。有关颜色命名的描述,请 请参见 X11 manpages。当然对于 <b class="userinput"><tt>menu.title.color</tt></b> 和 <b class="userinput"><tt>menu.frame.color</tt></b> 也是适用的。再看一个:</p><div class="example"><a name="id2468783"></a><p class="title"><b>例子 10.3. Font style</b></p><pre class="programlisting"> *font: -b&h-lucida-medium-r-normal-*-*-140-* </pre></div><p>所有键的“字体”资源的设置,像这样,一步即可到位。有关系统中所安装的字体的信息,您可以使用像 <tt class="filename">xfontsel</tt>,<tt class="filename">gfontsel</tt> 或 <tt class="filename">xlsfonts</tt> 这样的程序来了解。 </p><p>其实 Fluxbox 之所以吸引人的一个重要特色在于它的纹理实时渲染功能。纹理描述直接由它们所适用的键来指定,例如: </p><div class="example"><a name="id2468818"></a><p class="title"><b>例子 10.4. Texture style</b></p><pre class="programlisting"> toolbar.clock: Raised Gradient Diagonal Bevel1 toolbar.clock.color: rgb:8/6/4 toolbar.clock.colorTo: rgb:4/3/2 </pre></div><p>别急,我们马上就会解释这些指令的工作原理。一个纹理的描述由五个域组成,分别是:</p><div class="table"><a name="id2468836"></a><p class="title"><b>表格 10.1. Texture directives</b></p><table summary="Texture directives" border="0"><colgroup><col><col></colgroup><thead><tr><th>Directive</th><th>Description</th></tr></thead><tbody><tr><td>Flat / Raised / Sunken / Tiled</td><td><p>让组件的外观分别是 flat, raised 或者 sunken。</p><p> Tiled 只对 pixmaps 起作用而且并不产生缩放效应。 </p></td></tr><tr><td>Gradient / Solid</td><td>绘制单色或渐变色的纹理。</td></tr><tr><td>Horizontal / Vertical / Diagonal / Crossdiagonal / Pipecross / Elliptic / Rectangle / Pyramid</td><td>选择其中一个纹理类型。只有同时指定了 Gradient,它们才有效。</td></tr><tr><td>Interlaced</td><td>interlace the texture (darken every other line). 此选项常和渐变色纹理搭配使用,但自 Blackbox 0.60.3版后,(即所有的 Fluxbox 版本),同单色纹理也可一起使用。</td></tr><tr><td>Bevel1 / Bevel2</td><td>使用 bevel 的种类。Bevel1 是默认值,阴影处于图像边缘处。Bevel2 是替代选项,阴影处于图像边缘内侧 一像素内。</td></tr></tbody></table></div><p>除了纹理描述以外,还可以使用 <b class="userinput"><tt>ParentRelative</tt></b> 选项,可以让某个组件看起来就像 是其上一级的一部分。</p><p>所有渐变色纹理都有两个颜色值组成: <b class="userinput"><tt>color</tt></b> 和 <b class="userinput"><tt>colorTo</tt></b>。 在 <b class="userinput"><tt>Solid</tt></b> 模式 中使用 interlace 时,<b class="userinput"><tt>colorTo</tt></b> r用于查找 interlace 颜色。</p><p>提供了哪些键,每个键的取值情况怎样,这些问题的完整答案都可以在 <a href="#app-themeref" title="附录 C. Theme Reference">附录 C, <i>Theme Reference</i></a> 中找到。</p><p>乍一看,那么冗长的一张清单,但别忘了,要构造您自己的 style ,有时候用一条指令就可以轻松设置许多键的,例如:</p><div class="example"><a name="id2540714"></a><p class="title"><b>例子 10.5. Typical short style</b></p><pre class="programlisting"> *color: slategrey *colorTo: darkslategrey *unfocus.color: darkslategrey *unfocus.colorTo: black *textColor: white *unfocus.textColor: lightgrey *font: lucidasans-10 </pre></div></div></div><div class="appendix" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="app-setup"></a>附录 A. 建立 <tt class="filename">.xinitrc</tt>/<tt class="filename">.xsession</tt></h2></div></div><div></div></div><p>Verin 撰写</p><h4><a name="id2540781"></a>xinit 的地位</h4><p>窗口管理器只是又一个 X11 应用程序而已,就像 <tt class="filename">netscape</tt>, <tt class="filename">gimp</tt> 或 <tt class="filename">xterm</tt> 那样。许多刚刚接触 X11 的人以为是 X11 在执行窗口管理器,窗口管理器再执行其它程序。但这种看法是 其实是错误的。如果配置得当的话,您可以在运行各个应用程序的同时,退出正在使用的 窗口管理器,再运行另一个窗口管理器。</p><p>X11 <span class="emphasis"><em>真正</em></span>执行的程序,也就是用于执行其它程序的, 是您的 <tt class="filename">.xinitrc</tt> 或 <tt class="filename">.xsession</tt> 脚本。在启动 X11 的时候, <tt class="filename">.xinitrc</tt> 或 <tt class="filename">.xsession</tt> 脚本就开始运行,当脚本运行完毕后,X11 也就完成使命了。鉴于它的重要性,我再重复一次: <span class="emphasis"><em><tt class="filename">.xinitrc</tt> 执行完毕之时,也就是 X11 结束使命之日。</em></span> 窗口管理器 是否退出与此毫无干系。</p><h4><a name="id2517500"></a>脚本布局</h4><p>好吧,首先回顾一下您已经了解的知识。 在 shell 中敲入一条命令后,您就什么事都做不了了,除非等到该命令 执行完毕并退出。您的 <tt class="filename">.xinitrc</tt> 或 <tt class="filename">.xsession</tt> 脚本也是如此。当脚本开始执行时, 凡遇到任何一个需要很长时间运行的程序(多数 X11 程序都是这样的), 它就停在那儿等到该程序执行完毕为止。</p><p>理想情况下,脚本里应该只有一处使得 X11 挂起。并且您多半都希望它位于脚本的末端。 所以,如果您希望 X11 下的程序在未到达此“挂起点”前先运行,您应该将它们置于后台。 即在行尾添上一个<b class="userinput"><tt>&</tt></b>。假设在运行其它程序的同时,您 还想执行 <tt class="filename">xclock</tt>,将下面这行放在“挂起点“之前:</p><pre class="programlisting"> xclock & </pre><p>接下来就是您所看到的那个 <b class="userinput"><tt>exec</tt></b> 玩意儿, 很多参考资料在讲解如何将窗口管理器时添加到脚本中时都谈到了它。 但老实说,并不是非要它不可。如果您把窗口管理器放到脚本的最末端,即使不用 <b class="userinput"><tt>exec</tt></b>,X11 也会自动挂起。</p><p>那么要 <b class="userinput"><tt>exec</tt></b> 还有什么用呢?好吧,比方说您要在脚本里 放置多个窗口管理器的启动行,但只想使用一个。那么,您就可以利用 <b class="userinput"><tt>exec</tt></b> 将所选的启动行放到其它启动行前面。因为 <b class="userinput"><tt>exec</tt></b> 的意思就是:</p><p>"<span class="quote">用这个程序代替我,换言之,启动这个程序,等它一结束马上就终止我自己。</span>"</p><p>您要是把 <b class="userinput"><tt>exec wmaker</tt></b> 放到 <b class="userinput"><tt>exec enlightenment</tt></b> 的前面,那么当 <tt class="filename">wmaker</tt> 结束后,脚本也就执行完毕了,而不会继续执行下一行。</p><p>如果说不必要的话,您懂我的意思吗?用一组注释的窗口管理器启动行,也可以实现刚才的功能。</p><h4><a name="id2537175"></a>Another way to do things</h4><p>As an alternative, 您可以<span class="emphasis"><em>先</em></span>启动窗口管理器,然后将它的进程 ID 保存到某个环境变量中: </p><pre class="programlisting"> wmaker & wmpid=$! </pre><p>上面这一句代码将 wmaker 置于后台(<b class="userinput"><tt>&</tt></b>)运行 并将其进程 ID(<b class="userinput"><tt>$!</tt></b>)保存到变量(<b class="userinput"><tt>wmpid</tt></b>)中。 之后要构造“挂起点”时,只需 <b class="userinput"><tt>wait</tt></b>:</p><pre class="programlisting"> wait $wmpid </pre><p>要么也可以把您想要挂起的程序,如 <tt class="filename">gkrellm</tt> 之类的,置于前台来达到目的。 但要记住,当此程序一结束,X11 会话也就关闭了。</p><p>现在,我采用的是 <tt class="filename">wait</tt> 方法,因为我想在执行 dockapps 等等程序前 先执行我的窗口管理器。同样,在做其它事之前,我想先更改一下 X11 服务器的设置,比如 dpms,屏保,甚至是 扩充一下我的字体路径内容(安装一些我不想让别人使用的字体)。然后万事俱备后,我还想清理一下我的字体路径, 主要是因为在运行 display 管理器的时候,重置字体路径的效果一直不太好。</p><div class="example"><a name="id2537075"></a><p class="title"><b>例子 A.1. <tt class="filename">.xinitrc</tt></b></p><pre class="programlisting"> # turn off screen blanking and turn on energy star features xset s off xset dpms 600 60 60 # add my optional fonts to the font path xset +fp "$X_FONTPATH" xset fp rehash # export the current environment, in case it needs to be debugged env > ~/.xenv # window manager fluxbox & wmpid=$! bbrun & wmCalClock & wmxmms & # HANG POINT - wait for window manager to exit wait $wmpid # restore the x fontpath xset fp default </pre></div></div><div class="appendix" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="faq"></a>附录 B. Frequently asked questions (FAQ)</h2></div></div><div></div></div><div class="qandaset"><dl><dt>B.1. <a href="#id2530476">Slit 是什么?</a></dt><dt>B.2. <a href="#id2530509">有没什么方法可以让 Slit 中的 dockapps 按某种顺序摆放?</a></dt><dt>B.3. <a href="#id2530530">我怎么改变工具栏的时间显示格式?</a></dt><dt>B.4. <a href="#id2548687">我改动了我的 ~/.fluxbox/init,但是之后就被覆盖掉了。</a></dt><dt>B.5. <a href="#id2548710">标签的工作方式是怎样的?</a></dt><dt>B.6. <a href="#id2548729">在打开反锯齿功能后,我的字体就变得硕大无比!我该怎么解决这个问题?</a></dt><dt>B.7. <a href="#id2548760">看起来像 Snap 这样的老式字体不能用 AA... 这是怎么回事?</a></dt><dt>B.8. <a href="#id2540878">我一直听到有人在讨论什么 Artwiz 字体。能给点提示吗?</a></dt><dt>B.9. <a href="#id2540917">我如何设置我的背景?</a></dt><dt>B.10. <a href="#id2540936">当我更改主题时,背景变得惨不忍睹了。</a></dt><dt>B.11. <a href="#id2440138">我可以在 Fluxbox 中使用现有的 .blackboxrc 吗?</a></dt><dt>B.12. <a href="#id2440166">怎样才能在 Fluxbox 启动时自动运行应用程序?</a></dt><dt>B.13. <a href="#id2440193">我可以在 Fluxbox 中使用 Blackbox 的风格(主题)吗?</a></dt><dt>B.14. <a href="#id2440213">我该如何设置我的 .xinitrc/.xsession?</a></dt><dt>B.15. <a href="#id2440246">支持 KDE 吗?</a></dt><dt>B.16. <a href="#id2525062">支持 Gnome 吗?</a></dt><dt>B.17. <a href="#id2525086">BBtools 没有采用我当前的风格设置,即使重启后仍旧如此。</a></dt><dt>B.18. <a href="#id2525115">使用某些主题时,标签看起来好恶啊,怎么办啊?</a></dt><dt>B.19. <a href="#id2537974">怎样把图标放到 Fluxbox 的桌面上来呢?</a></dt><dt>B.20. <a href="#id2538020">Fluxbox 0.9.6 跑起来好慢啊...</a></dt></dl><table border="0" summary="Q and A Set"><col align="left" width="1%"><tbody><tr class="question"><td align="left" valign="top"><a name="id2530476"></a><a name="id2530478"></a><b>B.1.</b></td><td align="left" valign="top"><p>Slit 是什么?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>首先要明确的是 Slit <span class="emphasis"><em>不是</em></span>Fluxbox 的工具栏。</p><p>Slit 是 dockable applications 用来‘落脚’的地方。我们有专门的一章用来讲述 Slit: <a href="#chap-slit" title="章 7. Slit">章 7, <i>Slit</i></a>。在提出有关 “slit 是什么”以及“slit 如何工作”之类的问题时,先读完那一章。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2530509"></a><a name="id2530511"></a><b>B.2.</b></td><td align="left" valign="top"><p>有没什么方法可以让 Slit 中的 dockapps 按某种顺序摆放?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>在 Fluxbox 0.1.10之后的版本里,可以。<a href="#chap-slit" title="章 7. Slit">章 7, <i>Slit</i></a>中有解释。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2530530"></a><a name="id2530533"></a><b>B.3.</b></td><td align="left" valign="top"><p>我怎么改变工具栏的时间显示格式?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>在您的 <tt class="filename">init</tt> 中修改下面这一行:</p><pre class="programlisting"> session.screen0.strftimeFormat: %a %d %H:%M </pre><p>欲知此格式的信息,在电脑上运行 <b class="userinput"><tt>man 3 strftime</tt></b>。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2548687"></a><a name="id2548690"></a><b>B.4.</b></td><td align="left" valign="top"><p>我改动了我的 <tt class="filename">~/.fluxbox/init</tt>,但是之后就被覆盖掉了。</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>在 0.1.8-bugfix2 之前的版本中这个 bug 一直存在。在通报这个问题前请先升级到最新的版本或打上最新补丁。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2548710"></a><a name="id2548712"></a><b>B.5.</b></td><td align="left" valign="top"><p>标签的工作方式是怎样的?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>参见 <a href="#chap-tabs" title="章 4. 标签">章 4, <i>标签</i></a>。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2548729"></a><a name="id2548732"></a><b>B.6.</b></td><td align="left" valign="top"><p>在打开反锯齿功能后,我的字体就变得硕大无比!我该怎么解决这个问题?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>在 Xft 中,字体的处理方式与以往不同。对For starters, 在您的主题(style)文件中列出下面一行:</p><pre class="programlisting"> *.font: Verdana:size=7 </pre><p>用别的字体或尺寸当然也行,但上面提到的例子应该可以让菜单还用的过去。关于您想用的字体的种类信息,看 下面这个问题。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2548760"></a><a name="id2548763"></a><b>B.7.</b></td><td align="left" valign="top"><p>看起来像 Snap 这样的老式字体不能用 AA... 这是怎么回事?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>只要您在 Fluxbox 中激活 AA,它就依赖 Freetype2 渲染文字。如果您不用 AA,X11自身的字体渲染 就会启用。因为 FT2 <span class="emphasis"><em>不</em></span>支持 X11 所支持的全部格式,所以在 Fluxbox 中字体的选择余地非常有限。在本文档撰写之时,FT2 支持下列格式:</p><div class="itemizedlist"><ul type="disc"><li><p>TrueType 文件(.ttf) 和集合 (.ttc)</p></li><li><p>ASCII (.pfa) 或 二进制(.pfb)格式的 Type 1 字体文件。</p></li><li><p>Type 1 Multiple Master 字体</p></li><li><p>Type 1 CID-keyed 字体</p></li><li><p>OpenType/CFF (.otf) 字体</p></li><li><p>CFF/Type 2 字体</p></li><li><p>Adobe CEF 字体 (.cef)</p></li><li><p>Windows FNT/FON 位图字体</p></li></ul></div><p>另一方面,Freetype 1 只支持 TrueType 字体,即使通过使用第三方库可以启用对 GX 和 OTF 字体的支持。详细情况可以到 Freetype 主页上查找。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2540878"></a><a name="id2540881"></a><b>B.8.</b></td><td align="left" valign="top"><p>我一直听到有人在讨论什么 Artwiz 字体。能给点提示吗?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>在 <a href="#app-artwiz" title="附录 D. 在 Fluxbox 中使用 Artwiz 字体">附录 D, <i>在 Fluxbox 中使用 Artwiz 字体</i></a> 中给出了解释。</p><p>如果你喜欢 Artwiz 字体,但是不喜欢它们在终端里的样子,可以考虑一下 LFP 字体包,网址是 <a href="http://dreamer.nitro.dk/linux/lfp/" target="_top">Linux Font Project</a>。那儿有两套字体,一套是 LFP 宽度固定字体 (适合终端里采用),另一套是宽度可变字体 (适合其他场合)。前者在 Linux 控制台下也可以使用。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2540917"></a><a name="id2540919"></a><b>B.9.</b></td><td align="left" valign="top"><p>我如何设置我的背景?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>这个问题在<a href="#chap-bg" title="章 6. 桌面背景">章 6, <i>桌面背景</i></a>中有解答。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2540936"></a><a name="id2540939"></a><b>B.10.</b></td><td align="left" valign="top"><p>当我更改主题时,背景变得惨不忍睹了。</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p><a href="#chap-bg" title="章 6. 桌面背景">章 6, <i>桌面背景</i></a>中有一种解决方法。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2440138"></a><a name="id2440140"></a><b>B.11.</b></td><td align="left" valign="top"><p>我可以在 Fluxbox 中使用现有的 <tt class="filename">.blackboxrc</tt> 吗?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>当然可以,但别忘了给工具栏和 keygrabbing 添加相应的设置。将您的 <tt class="filename">blackboxrc</tt> 和 <tt class="filename">~/.fluxbox/init</tt> 用符号链接关联起来是个蛮聪明的做法。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2440166"></a><a name="id2440168"></a><b>B.12.</b></td><td align="left" valign="top"><p>怎样才能在 Fluxbox 启动时自动运行应用程序?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p> </p><p>参见 <a href="#app-setup" title="附录 A. 建立 .xinitrc/.xsession">附录 A, <i>建立 .xinitrc/.xsession</i></a>。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2440193"></a><a name="id2440196"></a><b>B.13.</b></td><td align="left" valign="top"><p>我可以在 Fluxbox 中使用 Blackbox 的风格(主题)吗?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>可以。两者的 tarballs 应该是 100% 可以呼唤使用的。对 Waimea 和 Openbox 项目来说也是如此,但我不敢担保。我也没有从两个项目中任何一方 处得到过这种承诺,但 Fluxbox 的一个目标就是保持和 Blackbox 风格的兼容。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2440213"></a><a name="qa-session"></a><b>B.14.</b></td><td align="left" valign="top"><p>我该如何设置我的 <tt class="filename">.xinitrc</tt>/<tt class="filename">.xsession</tt>?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>参见 <a href="#app-setup" title="附录 A. 建立 .xinitrc/.xsession">附录 A, <i>建立 .xinitrc/.xsession</i></a>。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2440246"></a><a name="id2525042"></a><b>B.15.</b></td><td align="left" valign="top"><p>支持 KDE 吗?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>是的,在 <tt class="filename">configure</tt> 中使用 <b class="userinput"><tt>--enable-kde</tt></b> 选项。这样就确保 KDE 托盘图标可以出现在 slit 中。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2525062"></a><a name="id2525065"></a><b>B.16.</b></td><td align="left" valign="top"><p>支持 Gnome 吗?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>是的,在 <tt class="filename">configure</tt> 中使用 <b class="userinput"><tt>--enable-gnome</tt></b> 选项。 这样便会启用 Gnome 提示。 在 Fluxbox 0.1.12 以上的版本中,默认情况下就是开启 Gnome 支持的。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2525086"></a><a name="id2525089"></a><b>B.17.</b></td><td align="left" valign="top"><p>BBtools 没有采用我当前的风格设置,即使重启后仍旧如此。</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>将您的 <tt class="filename">~/.blackboxrc</tt> 做一个到 <tt class="filename">~/.fluxbox/init</tt> 的简单链接就可以了,例如用如下命令:</p><pre class="programlisting"> $ ln -s ~/.fluxbox/init ~/.blackboxrc </pre></td></tr><tr class="question"><td align="left" valign="top"><a name="id2525115"></a><a name="id2525118"></a><b>B.18.</b></td><td align="left" valign="top"><p>使用某些主题时,标签看起来好恶啊,怎么办啊?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p><span class="emphasis"><em>0.1.14 或之前的版本。</em></span></p><p>要想标签看起来 (甚至更) 漂亮,您需要给您的风格(主题)添加额外的几项。但要注意, 你可以不必这么做,因为 Fluxbox 本身就足以调整到一个合适的颜色/风格。但如果想更进一步参与到外观的控制 上来,您或许需要添加下面几行:</p><div class="example"><a name="id2525140"></a><p class="title"><b>例子 B.1. 在 style 文件中自定义标签</b></p><pre class="programlisting"> ! -- tab style (for Fluxbox) window.tab.justify: Right window.tab.label.unfocus: Flat Solid window.tab.label.unfocus.color: rgb:AC/AC/AC window.tab.label.unfocus.textColor: black window.tab.label.focus: Raised Solid window.tab.label.focus.color: rgb:CC/CC/CC window.tab.label.focus.textColor: black window.tab.borderWidth: 1 window.tab.borderColor: rgb:10/10/10 window.tab.font: fixed ! --- end, tab style </pre></div><p>那好,上面这些是做什么的呢?主题制作都是和这类似的东西。如果曾经做过 Blackbox 主题的话,我相信对此您一定 不会陌生 (否则 <a href="#chap-themes" title="章 10. 主题">章 10, <i>主题</i></a> 或许会有用)。</p><p>同样要注意的是,经过添加修改后的主题在 Blackbox 中仍旧可以完好的使用,所以您什么都不会损失。</p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2537974"></a><a name="id2537976"></a><b>B.19.</b></td><td align="left" valign="top"><p>怎样把图标放到 Fluxbox 的桌面上来呢?</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>Fluxbox 中有个程序可以完成此功能,就是 <a href="http://fluxbox.sourceforge.net/fbdesk" target="_top">fbdesk</a>. 现阶段 <tt class="filename">fbdesk</tt> 还没有随 fluxbox 一同打包。还有其他一些选择:RoxFiler 项目,<a href="http://idesk.timmfin.net" target="_top">idesk</a>, <a href="http://garuda.newmail.ru/xtdesk_e.dhtml" target="_top">xdesk</a>。</p><p> </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id2538020"></a><a name="id2538023"></a><b>B.20.</b></td><td align="left" valign="top"><p>Fluxbox 0.9.6 跑起来好慢啊...</p></td></tr><tr class="answer"><td align="left" valign="top"><b></b></td><td align="left" valign="top"><p>在您 .xinitrc 文件中 exec fluxbox 语句前加上下面一行: </p><pre class="programlisting"> export LC_ALL=C </pre><p> 应该可以帮的上新的 Redhat 用户。 </p></td></tr></tbody></table></div></div><div class="appendix" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="app-themeref"></a>附录 C. Theme Reference</h2></div></div><div></div></div><div class="toc"><p><b>目录</b></p><dl><dt><span class="sect1"><a href="#id2511508">Theme directives</a></span></dt></dl></div><div class="sect1" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id2511508"></a>Theme directives</h2></div></div><div></div></div><p>这张表完整的记录了可用的主题指令,以及它们可以赋予的值。用法细节参见 <a href="#chap-themes" title="章 10. 主题">章 10, <i>主题</i></a>。</p><div class="table"><a name="id2540397"></a><p class="title"><b>表格 C.1. Toolbar styles</b></p><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><tbody><tr><td>toolbar</td><td>Texture</td></tr><tr><td>toolbar.height</td><td>Number</td></tr><tr><td>toolbar.color</td><td>Color</td></tr><tr><td>toolbar.colorTo</td><td>Color</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Buttons</th></tr></thead><tbody><tr><td>toolbar.button</td><td>Texture or ParentRelative</td></tr><tr><td>toolbar.button.color</td><td>Color</td></tr><tr><td>toolbar.button.colorTo</td><td>Color</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Color of unpressed button arrows</th></tr></thead><tbody><tr><td>toolbar.button.picColor</td><td>Color</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Buttons in pressed state</th></tr></thead><tbody><tr><td>toolbar.button.pressed</td><td>Texture (e.g. <b class="userinput"><tt>Sunken</tt></b>) or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>toolbar.button.pressed.color</td><td>Color</td></tr><tr><td>toolbar.button.pressed.colorTo</td><td>Color</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Color of pressed button arrows</th></tr></thead><tbody><tr><td>toolbar.button.pressed.picColor</td><td>Color</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Workspace label</th></tr></thead><tbody><tr><td>toolbar.label</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>toolbar.label.color</td><td>Color</td></tr><tr><td>toolbar.label.colorTo</td><td>Color</td></tr><tr><td>toolbar.label.textColor</td><td>Color</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Workspace label</th></tr></thead><tbody><tr><td>toolbar.workspace</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>toolbar.workspace.pixmap</td><td>Pixmap</td></tr><tr><td>toolbar.workspace.color</td><td>Color</td></tr><tr><td>toolbar.workspace.colorTo</td><td>Color</td></tr><tr><td>toolbar.workspace.textColor</td><td>Color</td></tr><tr><td>toolbar.workspace.font</td><td>Font</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Window label</th></tr></thead><tbody><tr><td>toolbar.windowLabel</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>toolbar.windowLabel.color</td><td>Color</td></tr><tr><td>toolbar.windowLabel.colorTo</td><td>Color</td></tr><tr><td>toolbar.windowLabel.textColor</td><td>Color</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Clock</th></tr></thead><tbody><tr><td>toolbar.clock</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>toolbar.clock.pixmap</td><td>Pixmap</td></tr><tr><td>toolbar.clock.color</td><td>Color</td></tr><tr><td>toolbar.clock.colorTo</td><td>Color</td></tr><tr><td>toolbar.clock.textColor</td><td>Color</td></tr><tr><td>toolbar.clock.font</td><td>Font</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Iconbar if empty</th></tr></thead><tbody><tr><td>toolbar.iconbar.empty</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>toolbar.iconbar.empty.pixmap</td><td>Pixmap</td></tr><tr><td>toolbar.iconbar.empty.color</td><td>Color</td></tr><tr><td>toolbar.iconbar.empty.colorTo</td><td>Color</td></tr><tr><td>toolbar.iconbar.empty</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Iconbar focused and unfocused</th></tr></thead><tbody><tr><td>toolbar.iconbar.focused</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>toolbar.iconbar.focused.pixmap</td><td>Pixmap</td></tr><tr><td>toolbar.iconbar.focused.color</td><td>Color</td></tr><tr><td>toolbar.iconbar.focused.colorTo</td><td>Color</td></tr><tr><td>toolbar.iconbar.focused.textColor</td><td>Color</td></tr><tr><td>toolbar.iconbar.focused.font</td><td>Font</td></tr></tbody></table><table summary="Toolbar styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Text</th></tr></thead><tbody><tr><td>toolbar.justify</td><td><b class="userinput"><tt>center</tt></b>, <b class="userinput"><tt>left</tt></b>, or <b class="userinput"><tt>right</tt></b></td></tr><tr><td>toolbar.font</td><td>Font</td></tr></tbody></table></div><div class="table"><a name="id2535104"></a><p class="title"><b>表格 C.2. Menu styles</b></p><table summary="Menu styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Title</th></tr></thead><tbody><tr><td>menu.title</td><td>Texture</td></tr><tr><td>menu.title.color</td><td>Color</td></tr><tr><td>menu.title.colorTo</td><td>Color</td></tr><tr><td>menu.title.textColor</td><td>Color</td></tr><tr><td>menu.title.font</td><td>Font</td></tr><tr><td>menu.title.justify</td><td><b class="userinput"><tt>center</tt></b>, <b class="userinput"><tt>left</tt></b>, or <b class="userinput"><tt>right</tt></b></td></tr></tbody></table><table summary="Menu styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Frame</th></tr></thead><tbody><tr><td>menu.frame</td><td>Texture</td></tr><tr><td>menu.frame.color</td><td>Color</td></tr><tr><td>menu.frame.colorTo</td><td>Color</td></tr><tr><td>menu.frame.textColor</td><td>Color</td></tr><tr><td>menu.frame.disableColor</td><td>Color</td></tr><tr><td>menu.frame.font</td><td>Font</td></tr><tr><td>menu.frame.justify</td><td><b class="userinput"><tt>center</tt></b>, <b class="userinput"><tt>left</tt></b>, or <b class="userinput"><tt>right</tt></b></td></tr></tbody></table><table summary="Menu styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Submenu bullets</th></tr></thead><tbody><tr><td>menu.bullet</td><td><b class="userinput"><tt>empty</tt></b>, <b class="userinput"><tt>triangle</tt></b>, <b class="userinput"><tt>square</tt></b>, or <b class="userinput"><tt>diamond</tt></b></td></tr><tr><td>menu.bullet.position</td><td><b class="userinput"><tt>right</tt></b> or <b class="userinput"><tt>left</tt></b></td></tr><tr><td>menu.submenu.pixmap</td><td>Pixmap</td></tr></tbody></table><table summary="Menu styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Highlighted item</th></tr></thead><tbody><tr><td>menu.hilite</td><td>Texture (e.g. <b class="userinput"><tt>Raised</tt></b>)</td></tr><tr><td>menu.hilite.color</td><td>Color</td></tr><tr><td>menu.hilite.colorTo</td><td>Color</td></tr><tr><td>menu.hilite.textColor</td><td>Color</td></tr><tr><td>menu.selected.pixmap</td><td>Pixmap</td></tr><tr><td>menu.unselected.pixmap</td><td>Pixmap</td></tr></tbody></table></div><div class="table"><a name="id2535929"></a><p class="title"><b>表格 C.3. Window styles</b></p><table summary="Window styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Title</th></tr></thead><tbody><tr><td>window.title.focus</td><td>Texture</td></tr><tr><td>window.title.focus.color</td><td>Color</td></tr><tr><td>window.title.focus.colorTo</td><td>Color</td></tr><tr><td>window.title.unfocus</td><td>Texture</td></tr><tr><td>window.title.unfocus.color</td><td>Color</td></tr><tr><td>window.title.unfocus.colorTo</td><td>Color</td></tr><tr><td>window.title.height</td><td>Number</td></tr></tbody></table><table summary="Window styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Label</th></tr></thead><tbody><tr><td>window.label.focus</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>window.label.focus.color</td><td>Color</td></tr><tr><td>window.label.focus.colorTo</td><td>Color</td></tr><tr><td>window.label.focus.textColor</td><td>Color</td></tr><tr><td>window.label.unfocus</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>window.label.unfocus.color</td><td>Color</td></tr><tr><td>window.label.unfocus.colorTo</td><td>Color</td></tr><tr><td>window.label.unfocus.textColor</td><td>Color</td></tr></tbody></table></div><div class="table"><a name="id2538470"></a><p class="title"><b>表格 C.4. Handlebar styles</b></p><table summary="Handlebar styles" border="0"><colgroup><col><col></colgroup><tbody><tr><td>window.handle.focus.color</td><td>Color</td></tr><tr><td>window.handle.focus.colorTo</td><td>Color</td></tr><tr><td>window.handle.unfocus</td><td>Texture</td></tr><tr><td>window.handle.unfocus.color</td><td>Color</td></tr><tr><td>window.handle.unfocus.colorTo</td><td>Color</td></tr></tbody></table></div><div class="table"><a name="id2536215"></a><p class="title"><b>表格 C.5. Resize grip styles</b></p><table summary="Resize grip styles" border="0"><colgroup><col><col></colgroup><tbody><tr><td>window.grip.focus</td><td>Texture</td></tr><tr><td>window.grip.focus.color</td><td>Color</td></tr><tr><td>window.grip.focus.colorTo</td><td>Color</td></tr><tr><td>window.grip.unfocus</td><td>Texture</td></tr><tr><td>window.grip.unfocus.color</td><td>Color</td></tr><tr><td>window.grip.unfocus.colorTo</td><td>Color</td></tr></tbody></table></div><div class="table"><a name="id2536291"></a><p class="title"><b>表格 C.6. Window button styles</b></p><table summary="Window button styles" border="0"><colgroup><col><col></colgroup><tbody><tr><td>window.button.focus</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>window.button.focus.color</td><td>Color</td></tr><tr><td>window.button.focus.colorTo</td><td>Color</td></tr><tr><td>window.button.focus.picColor</td><td>Color</td></tr><tr><td>window.button.unfocus</td><td>Texture or <b class="userinput"><tt>ParentRelative</tt></b></td></tr><tr><td>window.button.unfocus.color</td><td>Color</td></tr><tr><td>window.button.unfocus.colorTo</td><td>Color</td></tr><tr><td>window.button.unfocus.picColor</td><td>Color</td></tr><tr><td>window.button.pressed </td><td>Texture</td></tr><tr><td>window.button.pressed.color</td><td>Color</td></tr><tr><td>window.button.pressed.colorTo</td><td>Color</td></tr></tbody></table></div><div class="table"><a name="id2536052"></a><p class="title"><b>表格 C.7. Window frame styles</b></p><table summary="Window frame styles" border="0"><colgroup><col><col></colgroup><tbody><tr><td>window.frame.focusColor</td><td>Color</td></tr><tr><td>window.frame.unfocusColor</td><td>Color</td></tr></tbody></table></div><div class="table"><a name="id2536098"></a><p class="title"><b>表格 C.8. Tab styles</b></p><table summary="Tab styles" border="0"><colgroup><col><col></colgroup><tbody><tr><td>window.tab.justify</td><td><b class="userinput"><tt>right</tt></b>, <b class="userinput"><tt>left</tt></b> or <b class="userinput"><tt>center</tt></b></td></tr><tr><td>window.tab.label.unfocus</td><td>Texture</td></tr><tr><td>window.tab.label.unfocus.color</td><td>Color</td></tr><tr><td>window.tab.label.unfocus.textColor</td><td>Color</td></tr><tr><td>window.tab.label.focus</td><td>Texture</td></tr><tr><td>window.tab.label.focus.color</td><td>Color</td></tr><tr><td>window.tab.label.focus.textColor</td><td>Color</td></tr><tr><td>window.tab.borderWidth</td><td>Number of Pixels</td></tr><tr><td>window.tab.borderColor</td><td>Color</td></tr><tr><td>window.tab.font</td><td>Font</td></tr></tbody></table></div><div class="table"><a name="id2539755"></a><p class="title"><b>表格 C.9. Font on window label styles</b></p><table summary="Font on window label styles" border="0"><colgroup><col><col></colgroup><tbody><tr><td>window.font</td><td>Font</td></tr><tr><td>window.justify</td><td><b class="userinput"><tt>center</tt></b>, <b class="userinput"><tt>left</tt></b>, or <b class="userinput"><tt>right</tt></b></td></tr></tbody></table></div><div class="table"><a name="id2539810"></a><p class="title"><b>表格 C.10. Miscellaneous styles</b></p><table summary="Miscellaneous styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Border drawn around all components</th></tr></thead><tbody><tr><td>borderWidth</td><td>Number of pixels</td></tr><tr><td>borderColor</td><td>Color</td></tr><tr><td>bevelWidth</td><td>Number of pixels</td></tr><tr><td>handleWidth</td><td>Number of pixels</td></tr><tr><td>frameWidth</td><td>Number of pixels</td></tr></tbody></table><table summary="Miscellaneous styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Command to be executed whenever the style is loaded</th></tr></thead><tbody><tr><td>rootCommand</td><td>Shell command, e.g. <b class="userinput"><tt>fbsetbg nicepiccy.jpg</tt></b></td></tr></tbody></table><table summary="Miscellaneous styles" border="0"><colgroup><col><col></colgroup><thead><tr><th colspan="2">Old BB 0.51 resources</th></tr></thead><tbody><tr><td>menuFont</td><td>Font</td></tr><tr><td>titleFont</td><td>Font</td></tr></tbody></table></div></div></div><div class="appendix" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="app-artwiz"></a>附录 D. 在 Fluxbox 中使用 Artwiz 字体</h2></div></div><div></div></div><h2><a name="id2548805"></a>简介</h2><p>所谓的 Artwiz 字体其实是一个自称为 Artwiz 的家伙创造的一套字体(真够难以置信的)。 您可以前往<a href="http://artwizaleczapka.sourceforge.net/" target="_top"> sf </a> 下载与 gtk2/kde3 应用程序兼容的 aleczapka 的字体或是可能原始一点的<a href="http://www.xs4all.nl/~hanb/software/fluxbox/artwiz-fonts.tar.bz2" target="_top"> Han </a> 的字体。</p><p>如果手头上有 mandrake 的 RPM 包的话,您就不必手动安装这些字体了,因为它们包含在其中了。 否则的话,嗯,没关系,让我来告诉你怎么办。有两种方法可供安装 artwiz 字体: system-wide 和 user-only。</p><h2><a name="id2536352"></a>System-wide 安装</h2><p>如果您要为系统中的所有用户都装备上这套字体,请把源码包下载到<tt class="filename"> /tmp </tt>然后像 这样做:</p><pre class="programlisting"> # cd /usr/X11R6/lib/X11/fonts # tar xjf /tmp/artwiz-fonts.tar.bz2 # cd fluxbox-artwiz-fonts # mkfontdir # chkfontpath -q -a /usr/X11R6/lib/X11/fonts/fluxbox-artwiz-fonts:unscaled </pre><p>然后重启字体服务器即可。值得注意的是,您所用的发行版 可能会使用别的位置来存放系统范围的字体,像 <tt class="filename">/usr/share/fonts</tt>。但通常上面所列出的默认位置应该不会有问题。</p><h2><a name="id2537677"></a>User 安装</h2><p>如果您只想为单独一个用户配备的话,就更容易了。下载源码包到其主目录下,然后再:</p><pre class="programlisting"> $ tar xjf artwiz-fonts.tar.bz2 $ mv fluxbox-artwiz-fonts .fonts $ mkfontdir $HOME/.fonts </pre><p>编辑<tt class="filename"> .xinitrc </tt>或<tt class="filename"> .xsession </tt>文件(依赖于您启动 X11 方式而定),在启动 其它程序前先写上下面一行:</p><pre class="programlisting"> xset +fp $HOME/.fonts </pre><p>然后(重)启动 X11 并用<tt class="filename">xlsfonts</tt> 或 <tt class="filename"> xfontsel </tt>命令来检查系统是否已经识别 出了这套字体。</p><h2><a name="id2540339"></a>Bugs</h2><p>artwiz 字体有时会与您的 locale 设置相冲突。要让它们正常工作的话,您得把下面这两句代码放到 您的<tt class="filename"> .xinitrc </tt>或<tt class="filename"> .xsession </tt>文件开头:</p><pre class="programlisting"> export LC=C export LC_ALL=C </pre><p>这些设置是专门针对 locale 的。如果发现您的字体丢失或者其它与 locale 相关的问题,再把它们 去掉即可。而 aleczapka 提供了另外一种解决方案:</p><p>下面的方案可以让您在继续保留区域设置的同时也可以在 Fluxbox 中使用 Artwiz 字体。</p><h2><a name="id2540376"></a>Locale 设置的修正</h2><p>解决方案其实很简单。你所要做的只是修正<tt class="filename"> fonts.alias </tt>(和/或 <tt class="filename"> fonts.dir </tt>)文件。</p><p>这种方法也适用于其他的一些程序(比如 Evolution 和 UTF-8 )。首先您需要构造一个合适的 <tt class="filename"> fonts.dir </tt>文件。它应该位于 Artwiz 字体的安装目录。不然,就改到那个目录 并运行<tt class="filename"> mkfontdir</tt>。</p><p>该文件的语法简单易懂。第一行列出上述目录下的字体数目。接下来的每一行都是这种形式</p><pre class="programlisting"> font_filename fontname </pre><p>我们在这里举一个<tt class="filename"> fonts.dir </tt>文件的例子:</p><div class="example"><a name="id2511556"></a><p class="title"><b>例子 D.1. <tt class="filename">fonts.dir</tt></b></p><pre class="programlisting"> 14 glisp.pcf.gz -artwiz-glisp-medium-r-normal--11-110-75-75-p-90-iso646.1991-irv gelly.pcf.gz -artwiz-gelly-medium-r-normal--10-100-75-75-p-90-iso646.1991-irv edges.pcf.gz -artwiz-edges-medium-r-normal--10-100-75-75-m-50-iso646.1991-irv nu.pcf.gz nu drift.pcf.gz drift cure.pcf.gz cure aqui.pcf.gz aqui lime.pcf.gz -artwiz-lime-medium-r-normal--10-100-75-75-m-50-iso646.1991-irv snap.pcf.gz -artwiz-snap-medium-r-normal--10-100-75-75-p-90-iso646.1991-irv </pre></div><p>我们感兴趣的是那些由字体的简要描述所构成的条目,在此例中描述的是 Nu,Drift,Cure 和 Aqui 字体。 问题是它们缺乏完整的 X11 字体名称。</p><p>把文件改成:</p><pre class="programlisting"> 14 glisp.pcf.gz -artwiz-glisp-medium-r-normal--11-110-75-75-p-90-iso646.1991-irv gelly.pcf.gz -artwiz-gelly-medium-r-normal--10-100-75-75-p-90-iso646.1991-irv edges.pcf.gz -artwiz-edges-medium-r-normal--10-100-75-75-m-50-iso646.1991-irv nu.pcf.gz -artwiz-nu-medium-r-normal--11-110-75-75-p-90-iso646.1991-irv drift.pcf.gz -artwiz-drift-medium-r-normal--11-110-75-75-p-90-iso646.1991-irv cure.pcf.gz -artwiz-cure-medium-r-normal--11-110-75-75-p-90-iso646.1991-irv aqui.pcf.gz -artwiz-aqui-medium-r-normal--11-110-75-75-p-90-iso646.1991-irv lime.pcf.gz -artwiz-lime-medium-r-normal--10-100-75-75-m-50-iso646.1991-irv snap.pcf.gz -artwiz-snap-medium-r-normal--10-100-75-75-p-90-iso646.1991-irv </pre><p>最后要做的是修正您的<tt class="filename"> fonts.alias </tt>文件(以便在 iso646 之外 的其他 encoding 里也可以使用这些字体)。</p><p>语法是<b class="userinput"><tt>字体别名 字体名</tt></b>。例如,想在和 ISO-8859-2 encoding 下使用 Artwiz 字体的话,起个这样的别名(都只占用<span class="emphasis"><em>一</em></span>行)。</p><pre class="programlisting"> -artwiz-anorexia-medium-r-normal--11-110-75-75-p-90-iso8859-2 -artwiz-anorexia-medium-r-normal--11-110-75-75-p-90-iso646.1991-irv </pre><p>您也可以瞧瞧我的<a href="http://fluxbox.sourceforge.net/download/fonts.dir" target="_top"> fonts.dir </a> 和<a href="http://fluxbox.sourceforge.net/download/fonts.alias" target="_top"> fonts.alias </a> 文件,可以支持 ISO-8859-1,ISO-8859-2 和 iso10646-1 (UTF-8)。如果按照上面的方法设置的话,您就不需要将 LC_* 标志改成 C 或 POSIX 了。之后所有的应用程序(不只是 Fluxbox )都可以正常工作了; 而不再抱怨“can't convert character set”之类的了。</p></div><div class="appendix" lang="zh_cn"><div class="titlepage"><div><div><h2 class="title"><a name="app-debugging"></a>附录 E. 调试</h2></div></div><div></div></div><h2><a name="id2540979"></a>一般信息</h2><p>调试是一项可以通过学习来掌握的技艺。教你如何写好 bug 报告的优秀材料 很有一些,在动笔前请一定要先阅读一下,bug 终究逃不掉的,何况读读材料也不会要你的命。 我们是很想除掉 bug 的,而这离不开你的帮助 :-) 那么让我们全副武装直奔战场吧。 同时介绍两篇不错的文档<a href="http://www.mozilla.org/quality/bug-writing-guidelines.html" target="_top"> Bugzilla Bug Reporting HOWTO</a> 和 Simon Tathams 的<a href="http://www.chiark.greenend.org.uk/~sgtatham/bugs.html" target="_top"> How to Report Bugs Effectively </a>。</p><p>鉴于有些非官方补丁的性质,我们无法逐一给予支持。 这意味着(对你而言)你应该检查一下 Fluxbox 是否 是在<span class="emphasis"><em>没有</em></span>用这些补丁的情况下出现的崩溃现象。 如果采用的 Fluxbox 补丁是由发行版维护人员打上的, 你应该找他商量这个问题。</p><p>如果需要比这篇指南里提供的还要多的有关调试的帮助,你可以 看看 irc.freenode.net 的 #fluxbox 频道里的人能否帮得上忙。主开发人员和一大群 可胜任的人一般都在那儿,所以你的问题基本上都可以得到解决。</p><h2><a name="id2557912"></a>Fluxbox 相关的东西</h2><h3><a name="id2557918"></a>Fluxbox 的输出信息</h3><p>像其他应用程序一样 Fluxbox 从哪个控制台下启动就会把信息发送到哪里。问题是在正常情况下所有的输出信息都会流向 <span class="emphasis"><em>文本</em></span>控制台。将你的 Fluxbox 启动行改为<b class="userinput"><tt> exec xterm </tt></b>或者其它你喜欢的终端模拟器。启动 X11 时 Fluxbox 就会从那个 xterm 中自动运行,仔细瞧好, 你很容易就能看到 Fluxbox 放出的信息了。</p><h3><a name="id2538493"></a>我们需要的信息</h3><p>我们要知道很多东西。确保你对它们都清楚。</p><div class="itemizedlist"><ul type="disc"><li><p>你所用的操作系统 / 发行版以及版本。</p></li><li><p>Fluxbox 版本,如果是从 CVS 上安装的,那么是哪一天?</p></li><li><p>什么时候出的问题?你之前做了什么吗?你可以重现这个问题码?</p></li><li><p>你的配置。在<tt class="filename"> ~/.fluxbox/init </tt>中可以找到。</p></li></ul></div><h2><a name="id2538534"></a>怎么处理 core dumps。</h2><p>要是你使用 Fluxbox 的时候总是收到 core dump ,照着下面的指示来: 前往 OPN 上的 #fluxbox 频道,告诉 fluxgen(译注:fluxgen 就是 Henrik Kinnunen) 的你收到了一个 core dump。 它要什么信息你就提供给它。他可能会要你下面的事情。过程可能有些繁琐,但只要你稍微有点 常识和一些 Unix 的经验,其实并不难。对了,你需要 GNU 调试器,名称是<tt class="filename"> gdb </tt>。</p><h3><a name="id2538556"></a>重新编译 Fluxbox</h3><p>对,你没有看错!要成为一名真正的调试员,你必须带上调试符号重新构造一遍 Fluxbox 。</p><p>像平常那样去 Build Fluxbox,在 make 的时候加上以下选项:</p><pre class="programlisting"> $ CFLAGS=-Wall -g3 CXXFLAGS=-Wall -g3 make </pre><p>如果你使用的是 Fluxbox 站点或者你的发行版提供的源码包 RPMs,你可以这样: </p><pre class="programlisting"> $ su # rpm -ivh fluxbox-0.1.11.1mdk.src.rpm # cd /usr/src/RPM/SPECS # env DEBUG=true rpm -ba fluxbox.spec # rpm -Uvh --force /usr/src/RPM/RPMS/i686/fluxbox* # exit $ mkdir -p ~/src/fluxbox $ cp -R /usr/src/RPM/BUILD/fluxbox* ~/src/fluxbox </pre><p>进入 Fluxbox 目录(这样我们就不会搞错 core dump 了)。shell 有个俏皮功能用于禁止生成 core 文件。所以请确保 你真的得到了 core 文件:</p><pre class="programlisting"> $ ulimit -c unlimited </pre><p>启动 X11 让我们调试吧。怎么样可以让 Fluxbox 产生 core dump 就怎么做。 现在我们正式开始调试:</p><pre class="programlisting"> $ gdb fluxbox core </pre><p>先在<tt class="filename"> gdb </tt> (开头部分是 <tt class="filename"> gdb </tt>的提示符,不必敲入)里执行这个命令:</p><pre class="programlisting"> (gdb) where </pre><p>屏幕马上会给出许多输出。在这些信息中,凡是以<tt class="computeroutput"> # </tt> 开头的,Fluxgen 都需要知道。</p><p>然后将它们粘贴到邮件里,并把<tt class="filename">~/.fluxbox/</tt>目录下的 4个设置文件作为附件一并发送给 Fluxgen。</p><p>但请先不要删除 core 文件和源代码目录。Fluxgen 可能要向你询问一些额外的问题,到那时你还要 用到它们的。如果 Fluxgen 没有明确地索要,就不要把 core 文件发送给他-- 因为它是你的系统特有的,对他而言,很可能并没有多大用处,况且它体积还不小。</p></div></div></body></html>
返回至
Fluxbox指南
。