LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 19307|回复: 54

配置XGL - 实现如OSX般的超酷桌面

[复制链接]
发表于 2006-2-23 12:08:53 | 显示全部楼层 |阅读模式
配置XGL - 实现如OSX般的超酷桌面

时下,Linux社区最热门的话题之一莫过于对XGL和AIGLX的讨论和实现。XGL出自于Novell,完全基于OpenGL绘图引擎,通过利用nvidia/ATI显卡优良的硬件加速通道实现可用的2D/ 3D桌面。XGL可以说是新一代的建立在OpenGL基础上的X server。由于充分利用了显卡的GPU,运行速度相当的快。没有出现好看不好用的情况。个人觉得值得期待。AIGLX是RedHat/ Fedora项目下的一个增强目前X服务器显示效能的子项目,也是利用OpenGL的绘图引擎,但主要是在现有的X架构下进行扩展和对Mesa增加patch.动作不如Novell大。不过由于强调了将尽量依赖open source的driver, 很多人也看好。

官方网站:
XGL:http://en.opensuse.org/Xgl
AIGLX: http://fedoraproject.org/wiki/RenderingProject/aiglx

参考文献:
http://www.ubuntuforums.org/showthread.php?t=131267
http://www.ubuntuforums.org/showthread.php?t=131253
http://www.ubuntuforums.org/showthread.php?t=134657
http://ubuntuforums.org/showthread.php?t=132063


大致的介绍了一下后,现在看看如何在ubuntu Dapper下配置实现XGL。(Breezy没有试过,但应该也是可行的。) 声明一下的是目前这些技术都还处在开发阶段(尽管本人觉得已经相当的稳定了),但还是有可能造成系统不稳定。如果你出现了问题,可以到这里讨论。还有就是由于XGL是基于OpenGL绘图引擎的,所以你必须有nVIDIA或ATI显卡(如果有人能在非这两种卡的情况下配置成功,请告知,我会将这段修改)。nVIDIA的基本要在Geforce2以上,ATI在r200以上。因为看到网上很多人都报怨现行的驱动已经不支持很旧显卡了。使用nv驱动的肯定不行。(我在nvidia的TNT2上用nv的驱动试了,不行)还有本文主要针对nVidia显卡,因为我没有ATI卡,所以也无法尝试。

1. 确保你打开了sources.list中的universe和multiverse源。怎么打开我就不多讲了。
2. 确保升级到最新的nvidia驱动.
  1. apt-get update && apt-get install linux-restricted-modules-$(uname -r) nvidia-glx nvidia-glx-dev nvidia-kernel-common
复制代码

3. 完成之后,我们开始配置xorg.conf.首先做个备份,以免出错后无法回复。
  1. cp /etc/X11/xorg.conf /etc/X11/xorg.conf.orig
复制代码
。现在开始配置。看到"Module"的部分,将"Load "dri""注释掉。然后加上"Load "glx"".完成之后象这样:
  1.     Load           "glx"
  2. #    Load      "dri"
复制代码
.其他的不用修改。然后看到"Device"部分。参照下面的配置改:

  1. Section "Device"
  2.     Identifier     "NVIDIA Corporation NV17 [GeForce4 420 Go 32M]"
  3.     Driver         "nvidia"
  4.     Option          "NvAGP" "1"
  5.     Option          "NoLogo" "true"
  6.     Option          "RenderAccel" "true"
  7.     Option          "AllowGLXWithComposite" "true"
  8.     Option "CursorShadow" "1"
  9. EndSection
复制代码
"Identifier不要照抄我的,你的显卡是什么型号就是什么。Driver一定要将"nv"改为"nvidia". Option "NvAGP" "1"表示用agpgart模块。如果你是PCIE显卡,不用这个。option "NoLogo" "true"表示不显示nvidia的logo. option "RenderAccel" "true"表示打开显卡的硬件加速。option "AllowGLXWithComposite" "true"表示利用OpenGL来进行图形的合成渲染。最后option "CursorShadow" "1"表示显示鼠标阴影。(这是我原来有的,和XGL没什么关系,加不加无所谓。)好了,如果你已经完成,那么xorg.conf的部分就完成。Save你的xorg.conf文件。
4. 重启X或是重启电脑,保证所有的driver和modules都能正常的加载。如果你发现X起不来了,那么你基本上可以在这停下了。恢复原来你备份的xorg. conf然后看看到底是怎么回事。如果你的X还能起,那么,请继续。
5. 这一步我们安装全新的XGL服务器和图形合成管理器。同样,必须打开universe和multiverse源。
  1. apt-get install compiz xserver-xgl libgl1-mesa xserver-xorg libglitz-glx1 compiz- gnome
复制代码

6. 完成了之后,我们来配置gdm.

  1. vi /etc/gdm/gdm.conf-custom
复制代码
将下面的配置文件完全照抄

  1. # GDM Configuration Customization file.
  2. #
  3. # This file is the appropriate place for specifying your customizations to the
  4. # GDM configuration.   If you run gdmsetup, it will automatically edit this
  5. # file for you and will cause the daemon and any running GDM GUI programs to
  6. # automatically update with the new configuration.  Not all configuration
  7. # options are supported by gdmsetup, so to modify some values it may be
  8. # necessary to modify this file directly by hand.
  9. #
  10. # To hand-edit this file, simply add or modify the key=value combination in
  11. # the appropriate section in the template below.  Refer to the comments in the
  12. # gdm.conf file for information about each option.  Also refer to the reference
  13. # documentation.
  14. #
  15. # If you hand edit a GDM configuration file, you should run the following
  16. # command to get the GDM daemon to notice the change.  Any running GDM GUI
  17. # programs will also be notified to update with the new configuration.
  18. #
  19. # gdmflexiserver --command="UPDATE_CONFIG <configuration key>"
  20. #
  21. # For example, the "Enable" key in the "[debug]" section would be specified by
  22. # "debug/Enable".
  23. #
  24. # You can also run gdm-restart or gdm-safe-restart to cause GDM to restart and
  25. # re-read the new configuration settings.  You can also restart GDM by sending
  26. # a HUP or USR1 signal to the daemon.  HUP behaves like gdm-restart and causes
  27. # any user session started by GDM to exit immediately while USR1 behaves like
  28. # gdm-safe-restart and will wait until all users log out before restarting GDM.
  29. #
  30. # For full reference documentation see the gnome help browser under
  31. # GNOME|System category.  You can also find the docs in HTML form on
  32. # http://www.gnome.org/projects/gdm/
  33. #
  34. # NOTE: Lines that begin with "#" are considered comments.
  35. #
  36. # Have fun!

  37. [daemon]

  38. [security]

  39. [xdmcp]

  40. [gui]

  41. [greeter]

  42. [chooser]

  43. [debug]

  44. [servers]
  45. 0=Xgl

  46. [server-Xgl]
  47. name=Xgl server
  48. command=/usr/bin/Xgl :0 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo
  49. flexible=true
复制代码

注意:上面这个配置只能用于nVIDIA显卡.如果你是ATI显卡,将[server]以下的内容改成

  1. [servers]
  2. 1=Xgl

  3. [server-Xgl]
  4. name=Xgl server
  5. command=/usr/bin/Xgl :1 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo
  6. flexible=true
复制代码

然后,你还要将gdm.conf中
  1. 0=Standard
  2. #1=Standard
复制代码
改成:
  1. #0=Standard
  2. 1=Standard
复制代码
这样gdm将缺省用显示屏幕1而不是0. 还有上面gdm的配置文件都是老外写的,我只是拿来用。
7. 现在来配置OpenGL composite manager,这个将取代metacity来渲染和设定窗口的行为。值得注意的是在metacity下设定的快捷键都将没有用了。

  1. sudo vi /usr/bin/start_compiz
  2. #!/bin/bash
  3. gnome-window-decorator &
  4. compiz --replace gconf decoration wobbly fade minimize cube rotate zoom scale move resize place menu switcher opacity &
复制代码
这个script也是抄的。
  1. sudo chmod 755 /usr/bin/start_compiz
复制代码

opacity这个plugin并没有安装。我们要到[color="Red"]这里下载。然后

  1. sudo tar xvfz /path/to/your/compiz_opacity.tar.gz -C /usr/lib/compiz/
复制代码

8.好了,基本上都完成了。你可以重启机器或X来起动XGL,然后在terminal下输入
  1. start_compiz
复制代码
如果你看到你的窗口被重新绘制了,恭喜,你已经用上了目前最炫的Linux 3D桌面。如果你想看看有多酷,试试下面的Hotkeys: (这些Hotkeys都可以在gconf-editor->apps->compiz->plugins->... 的各个plugin中查看和修改。我列的这些都是缺省值)想看看OSX的窗口排列吗:F12
Vista样式的窗口切换<Alt><Tab>
立方体桌面切换<Control><Alt>+left/right key
立方体切换并保持当前窗口<Shift><Control><Alt>+left/right key
想看看透明窗口吗:<Shift><Control>+scrollmouse
想看看放大缩小吗:<Shift><Alt>+scrollmouse
...酷吧。Have fun ...
顺便附张小图。

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
发表于 2006-2-23 22:19:38 | 显示全部楼层
收藏了,搞搞试试看
回复 支持 反对

使用道具 举报

发表于 2006-2-23 22:59:36 | 显示全部楼层
早就装好了,不过兄弟才这么有心写出教程来。谢谢!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2006-2-23 23:11:03 | 显示全部楼层
我在用fcitx输入时xgl会crash,不知其他人有没有这样的情况。特别是按住shift键输入英文时。
回复 支持 反对

使用道具 举报

发表于 2006-2-23 23:50:54 | 显示全部楼层
谁发个a卡的啊,我一装就花屏的不行.
回复 支持 反对

使用道具 举报

发表于 2006-2-24 08:22:25 | 显示全部楼层

INTEL 的集成显卡GMA900可不可以啊

INTEL 的集成显卡GMA900可不可以啊
回复 支持 反对

使用道具 举报

发表于 2006-2-24 08:47:48 | 显示全部楼层
强烈要求发a卡的
回复 支持 反对

使用道具 举报

发表于 2006-2-24 10:30:04 | 显示全部楼层
很眩目,但我的GeForce2 MX/MX 400估计够呛。
回复 支持 反对

使用道具 举报

发表于 2006-2-24 11:59:45 | 显示全部楼层
发A卡啊,我这里别说3d了,一装2d都不行了。
回复 支持 反对

使用道具 举报

发表于 2006-2-24 14:26:37 | 显示全部楼层
我的出现Failed to load shadow images
compiz.real:No composition extention
我的是ATI 9500 Pro显卡,AMD AthlonXP CPU
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表