Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| zh-cn:tips [2012/04/27 18:00] – [Accessing man pages through xfrun4] haobug | zh-cn:tips [2026/11/06 04:10] (current) – removed kevinbowen | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== 提示与技巧 ====== | ||
| - | 此页面包含了 Xfce 桌面环境的多种技巧。 | ||
| - | ===== 自定义面板时钟插件字体 ===== | ||
| - | |||
| - | |||
| - | 你可以用[[http:// | ||
| - | |||
| - | 例如: | ||
| - | * ''< | ||
| - | * ''< | ||
| - | |||
| - | ===== 性能提示 ===== | ||
| - | |||
| - | 让我们面对它吧:使用 Xfce 的原因之一是性能。它更轻量,在几乎所所件硬件平台比 Gnome 反应更灵敏,尤其是在较少的内存和处理器能力的机器上。 | ||
| - | ==== 字体 ==== | ||
| - | |||
| - | 字体对 GUI 性能有**极大**影响。全部打开字体平滑,微调和渲染,你会注意菜单对话框出现时有明显的延迟。当你把这些全部关闭,出现要快(实际上是敏捷)**很多**。 | ||
| - | |||
| - | |||
| - | 关掉这这些微调/ | ||
| - | 看起来非常光滑,只是可能看起了有点粗。也欢迎推荐其他字体。 | ||
| - | |||
| - | 我在 CRT 显示器上使用 Fixed 字体(12号+),感觉效果很好。很容易看清不用开抗锯齿。看起为不错并且跑得快。 | ||
| - | ==== 背景颜色 ==== | ||
| - | |||
| - | 我经常使用 vncserver 远程连接,我总是感觉很慢,反应迟钝,特别是关闭程序窗口的时候。比如,关闭 Firefox 的时候,需要30到60 秒钟才能完成,在这期间,系统完全没有反应。 | ||
| - | 我修改了我的背景为纯白色,现在的所有程序(包括 Firefox )1到2秒内就可以关闭了。 | ||
| - | |||
| - | 右击桌面,选择”设置“,然后”桌面设置“。请确保”显示图像“是未选中的。并设置”颜色风格“为”纯色”,然后设置第一个颜色为白色(#FFFFFF)。 | ||
| - | |||
| - | 另外一个选择,对一些软件可能有用,那就是查看你用来远程连接的程序的设置选项,如果有”去掉墙纸“或者”不显示墙纸“的选项,那就打开这个选项。我用的是 TightVNCviewer,它没有”去掉墙纸“的选项,所以修改背景颜色是我的唯一的解决办法。 | ||
| - | ===== 如何使用 GNOME 菜单 ===== | ||
| - | |||
| - | 如果你想使用 GNOME 的新菜单, 比如用快速启动的喜欢的应用之类的话,你可以使用的 [[http:// | ||
| - | |||
| - | 在您的面板上添加一个新 xfapplet 项,并打开其属性对话框添加GNOME 菜单的小程序。 | ||
| - | |||
| - | 如果你不喜欢GNOME主菜单,可以试一下Ubuntu系统面板,在几种发行上找得到。 | ||
| - | |||
| - | 另见:[[/ | ||
| - | |||
| - | |||
| - | ===== gtkrc 文件 ===== | ||
| - | |||
| - | * 在[[http:// | ||
| - | |||
| - | * Xfce也有一些应用有自定义的 gtkrc 设置:[[http:// | ||
| - | |||
| - | * 你不能定义 Thunar 图标/ | ||
| - | |||
| - | * 你可以像这样定义自定义的面板背景: | ||
| - | |||
| - | # ~/ | ||
| - | style " | ||
| - | bg_pixmap[NORMAL] | ||
| - | bg_pixmap[PRELIGHT] | ||
| - | bg_pixmap[ACTIVE] | ||
| - | bg_pixmap[SELECTED] | ||
| - | bg_pixmap[INSENSITIVE] | ||
| - | } | ||
| - | style " | ||
| - | fg[NORMAL] | ||
| - | fg[ACTIVE] | ||
| - | bg[NORMAL] | ||
| - | bg[PRELIGHT] | ||
| - | bg[ACTIVE] | ||
| - | } | ||
| - | widget_class " | ||
| - | widget " | ||
| - | widget " | ||
| - | widget " | ||
| - | widget_class " | ||
| - | class " | ||
| - | class " | ||
| - | class " | ||
| - | |||
| - | * 参考下论坛的这些贴子: http:// | ||
| - | ===== 如何删除和添加系统菜单中应用程序 ===== | ||
| - | |||
| - | === 添加应用程序 === | ||
| - | |||
| - | 你必须为你想要添加的应用程序创建一个 .desktop 文件(通常创建在下列位置中, ''/ | ||
| - | |||
| - | 在下面的例子中,我们在 “多媒体” 菜单中创建了一个名为 “foo” 的子菜单: | ||
| - | |||
| - | [Desktop Entry] | ||
| - | Encoding=UTF-8 | ||
| - | Name=foo | ||
| - | GenericName=bar | ||
| - | Comment=Senseless program ever | ||
| - | Exec=foobar | ||
| - | Icon=/ | ||
| - | Terminal=false | ||
| - | Type=Application | ||
| - | Categories=Multimedia; | ||
| - | |||
| - | 你可以在 [[http:// | ||
| - | |||
| - | libexo 提供了好几个实用工具,其中有一个可以以图形方式处理 desktop 文件: **exo-desktop-item-edit**。 你可以用它创建一个新的 .desktop 文件,用命令 ''< | ||
| - | |||
| - | === 删除应用程序 === | ||
| - | 你有两种方法: | ||
| - | * 第一种,并且也是更简单的一种就是直接删除 ''/ | ||
| - | * 第二种,添加这一行到 .desktop 文件中: | ||
| - | |||
| - | NoDisplay=true | ||
| - | |||
| - | =====怎样自定义 Xfce 启动===== | ||
| - | |||
| - | 像大多数 UNIX 终端会话一样,Xfce 在启动时会执行用户自定义的启动文件。你可以通过修改这个初始化文件来执行你自己的脚本,给 GUI 发送界面环境变量等。 | ||
| - | |||
| - | 请像这样编辑 xinitrc 文件,添加你自己的启动代码: | ||
| - | |||
| - | * 复制 / | ||
| - | * 添加你自己的代码到这个文件。例如,你可以启动 rxvt-unicode 服务器: | ||
| - | * source $HOME/ | ||
| - | * # start rxvt-unicode server | ||
| - | * urxvtd -q -o -f | ||
| - | |||
| - | 你可以从这了解更多关于 xinitrc 的内容 [[http:// | ||
| - | |||
| - | ==== Starting with showing the Root Window ==== | ||
| - | - xfdesktop --quit | ||
| - | - save your session | ||
| - | |||
| - | |||
| - | ===== Use the desktop margin ===== | ||
| - | |||
| - | To set the desktop margins, use the Settings Manager (**Settings Manager > Workspaces & Margins > Margins**). | ||
| - | |||
| - | The desktop margins are used to limit the size of maximized windows. This may be useful to avoid switching workspaces by accidentally mousing off the side of the screen. | ||
| - | |||
| - | The margins are also useful if you have only one Xfce panel: the margin area leaves a clear space to pull up application or workspace menus. By default, right click on the desktop (the margin) to show the Xfce menu, or middle (left+right) click to show the workspace menu. | ||
| - | |||
| - | The size of the margins is in pixels, so, with a reasonably modern monitor, at a resolution of, say 1680 x 1050, a setting of ' | ||
| - | |||
| - | ===== Handle acpi event for power button, show Xfce logout options ===== | ||
| - | |||
| - | If you would like the xfce logout menu to show up when you press your power button, and your machine has acpi support, then do the following: | ||
| - | |||
| - | ==== Solution 1 ==== | ||
| - | * ''/ | ||
| - | < | ||
| - | # / | ||
| - | # This is called when the user presses the power button and calls | ||
| - | # / | ||
| - | |||
| - | # Optionally you can specify the placeholder %e. It will pass | ||
| - | # through the whole kernel event message to the program you've | ||
| - | # specified. | ||
| - | |||
| - | # We need to react on " | ||
| - | # of kernel changes. | ||
| - | |||
| - | event=button[ /]power | ||
| - | action=/ | ||
| - | </ | ||
| - | |||
| - | * ''/ | ||
| - | < | ||
| - | # | ||
| - | # xfce4-shutdown-as-user.sh | ||
| - | # | ||
| - | # Check how many users are currently logged into X. | ||
| - | # If only one user is logged in, run a script which sets | ||
| - | # up the environment to call xfce4-session-logout. | ||
| - | |||
| - | LOGGED_IN_USER=`ls -trl / | ||
| - | NUM_X_USERS=`echo $LOGGED_IN_USER | wc -l` | ||
| - | | ||
| - | if [ $NUM_X_USERS -eq 1 ]; then | ||
| - | sudo -H -u $LOGGED_IN_USER / | ||
| - | fi | ||
| - | </ | ||
| - | |||
| - | * ''/ | ||
| - | < | ||
| - | #!/bin/sh | ||
| - | # xfce4-user-session-shutdown.sh | ||
| - | # | ||
| - | # Set up the environment so that DISPLAY and | ||
| - | # SESSION_MANAGER are valid, and xfce4-session-logout can run | ||
| - | |||
| - | HOST=`hostname` | ||
| - | SESSION_ID=`ls -t / | ||
| - | # Note that distros use different syntax for the SESSION_MANAGER variable (this script has Debian' | ||
| - | # If this does not work, then try something like SESSION_MANAGER=" | ||
| - | # instead. You can always find the correct format for your distribution by looking at the | ||
| - | # value of SESSION_MANAGER in a X session. | ||
| - | DISPLAY=:0 SESSION_MANAGER=" | ||
| - | </ | ||
| - | |||
| - | * Make those scripts executable : | ||
| - | < | ||
| - | chmod +x / | ||
| - | </ | ||
| - | ==== Solution 2 ==== | ||
| - | * Open Settings Manager (or by command : xfce4-settings-manager ) | ||
| - | * Open Power Manager settings | ||
| - | * In General : set //When power button is pressed// to //Ask// | ||
| - | * Close Power Manager settings | ||
| - | * In the file **/ | ||
| - | < | ||
| - | event=button/ | ||
| - | # | ||
| - | action=/ | ||
| - | </ | ||
| - | ===== 使用助记符创建 Thunar 自定义动作 ===== | ||
| - | |||
| - | 当你创建一个 [[http:// | ||
| - | =====通过 xfrun4 打开用户手册页===== | ||
| - | |||
| - | 使用 '#' | ||