|
配置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驱动.- apt-get update && apt-get install linux-restricted-modules-$(uname -r) nvidia-glx nvidia-glx-dev nvidia-kernel-common
复制代码
3. 完成之后,我们开始配置xorg.conf.首先做个备份,以免出错后无法回复。- cp /etc/X11/xorg.conf /etc/X11/xorg.conf.orig
复制代码 。现在开始配置。看到"Module"的部分,将"Load "dri""注释掉。然后加上"Load "glx"".完成之后象这样:.其他的不用修改。然后看到"Device"部分。参照下面的配置改:
- Section "Device"
- Identifier "NVIDIA Corporation NV17 [GeForce4 420 Go 32M]"
- Driver "nvidia"
- Option "NvAGP" "1"
- Option "NoLogo" "true"
- Option "RenderAccel" "true"
- Option "AllowGLXWithComposite" "true"
- Option "CursorShadow" "1"
- 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源。- apt-get install compiz xserver-xgl libgl1-mesa xserver-xorg libglitz-glx1 compiz- gnome
复制代码
6. 完成了之后,我们来配置gdm.
- vi /etc/gdm/gdm.conf-custom
复制代码 将下面的配置文件完全照抄
- # GDM Configuration Customization file.
- #
- # This file is the appropriate place for specifying your customizations to the
- # GDM configuration. If you run gdmsetup, it will automatically edit this
- # file for you and will cause the daemon and any running GDM GUI programs to
- # automatically update with the new configuration. Not all configuration
- # options are supported by gdmsetup, so to modify some values it may be
- # necessary to modify this file directly by hand.
- #
- # To hand-edit this file, simply add or modify the key=value combination in
- # the appropriate section in the template below. Refer to the comments in the
- # gdm.conf file for information about each option. Also refer to the reference
- # documentation.
- #
- # If you hand edit a GDM configuration file, you should run the following
- # command to get the GDM daemon to notice the change. Any running GDM GUI
- # programs will also be notified to update with the new configuration.
- #
- # gdmflexiserver --command="UPDATE_CONFIG <configuration key>"
- #
- # For example, the "Enable" key in the "[debug]" section would be specified by
- # "debug/Enable".
- #
- # You can also run gdm-restart or gdm-safe-restart to cause GDM to restart and
- # re-read the new configuration settings. You can also restart GDM by sending
- # a HUP or USR1 signal to the daemon. HUP behaves like gdm-restart and causes
- # any user session started by GDM to exit immediately while USR1 behaves like
- # gdm-safe-restart and will wait until all users log out before restarting GDM.
- #
- # For full reference documentation see the gnome help browser under
- # GNOME|System category. You can also find the docs in HTML form on
- # http://www.gnome.org/projects/gdm/
- #
- # NOTE: Lines that begin with "#" are considered comments.
- #
- # Have fun!
- [daemon]
- [security]
- [xdmcp]
- [gui]
- [greeter]
- [chooser]
- [debug]
- [servers]
- 0=Xgl
- [server-Xgl]
- name=Xgl server
- command=/usr/bin/Xgl :0 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo
- flexible=true
复制代码
注意:上面这个配置只能用于nVIDIA显卡.如果你是ATI显卡,将[server]以下的内容改成
- [servers]
- 1=Xgl
- [server-Xgl]
- name=Xgl server
- command=/usr/bin/Xgl :1 -fullscreen -ac -accel glx:pbuffer -accel xv:fbo
- flexible=true
复制代码
然后,你还要将gdm.conf中改成:这样gdm将缺省用显示屏幕1而不是0. 还有上面gdm的配置文件都是老外写的,我只是拿来用。
7. 现在来配置OpenGL composite manager,这个将取代metacity来渲染和设定窗口的行为。值得注意的是在metacity下设定的快捷键都将没有用了。
- sudo vi /usr/bin/start_compiz
- #!/bin/bash
- gnome-window-decorator &
- compiz --replace gconf decoration wobbly fade minimize cube rotate zoom scale move resize place menu switcher opacity &
复制代码 这个script也是抄的。- sudo chmod 755 /usr/bin/start_compiz
复制代码
opacity这个plugin并没有安装。我们要到[color="Red"]这里下载。然后
- sudo tar xvfz /path/to/your/compiz_opacity.tar.gz -C /usr/lib/compiz/
复制代码
8.好了,基本上都完成了。你可以重启机器或X来起动XGL,然后在terminal下输入如果你看到你的窗口被重新绘制了,恭喜,你已经用上了目前最炫的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
|