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/21 09:14] – [Gtkrc files] 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:// | ||
| - | ===== How to add or remove applications in the system menu ===== | ||
| - | |||
| - | === Add an application === | ||
| - | You have to create a .desktop file (usually in ''/ | ||
| - | |||
| - | In the following example, we create an entry in the menu with the name " | ||
| - | |||
| - | [Desktop Entry] | ||
| - | Encoding=UTF-8 | ||
| - | Name=foo | ||
| - | GenericName=bar | ||
| - | Comment=Senseless program ever | ||
| - | Exec=foobar | ||
| - | Icon=/ | ||
| - | Terminal=false | ||
| - | Type=Application | ||
| - | Categories=Multimedia; | ||
| - | |||
| - | You can read more about .desktop files [[http:// | ||
| - | |||
| - | The libexo provides several utils amongst one to handle desktop entry files in a GUI fashion: **exo-desktop-item-edit**. | ||
| - | |||
| - | === Remove an application from the menu === | ||
| - | You can do this in two ways: | ||
| - | * First way, and the easier one is to simply remove the .desktop file in the ''/ | ||
| - | * The second way is to add this line to the .desktop file: | ||
| - | |||
| - | NoDisplay=true | ||
| - | |||
| - | =====How to customize starting Xfce===== | ||
| - | |||
| - | Like most UNIX terminal sessions, Xfce runs through user-customizable startup file when it starts up. You can edit this init file to run your own scripts, send environment variables to the GUI, etc. | ||
| - | |||
| - | To add your own startup code, edit the xinitrc file like this: | ||
| - | |||
| - | * Copy the file / | ||
| - | * Add your own code to the file. For example, you could start the rxvt-unicode server: | ||
| - | * source $HOME/ | ||
| - | * # start rxvt-unicode server | ||
| - | * urxvtd -q -o -f | ||
| - | |||
| - | You can read more about xinitrc at [[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=/ | ||
| - | </ | ||
| - | ===== Use mnemonics to create Thunar Custom Actions ===== | ||
| - | |||
| - | When you create a [[http:// | ||
| - | |||
| - | ===== Accessing man pages through xfrun4 ===== | ||
| - | Use '#' | ||