歡迎您光臨本站 註冊首頁

Fedora 7 ATI 顯卡 3D桌面的實現

←手機掃碼閱讀     火星人 @ 2014-03-25 , reply:0

作者:linlin911911

目錄:
一。引言
二。驅動
三。裝XGL
四。裝compiz 或者berly
五。後記
六。附錄

文章摘要:
本文簡要論述了在Fedora 7 使用ATI現卡實現33D桌面效果的方法。實際上本文可以拓展到N卡的。

一。引言
我是linux新手哦,請大家多多關照,謝了。

講講大約兩年前和linux的事吧

雖然以前也裝過redhat9.0,不過是在我弟的電腦裝的。
我電腦裝不上,就是裝上后,開機一片黑,對一個新手絕對是一大挑戰,費了老大勁還是沒裝顯卡驅動,MSI的9550小強版的第一版,(據說後來的縮水嚴重,廠家呀)。還是不死心,在我弟MX400顯卡的電腦裝的,硬碟安裝的。在過去,廠家對驅動支持太差了,不像現在版本更新快,對驅動支持好。
當時很不好用,要優化設置的東西太多了,最主要的是反應滿,裝了不久就刪。當然也裝過國產的redflag(紅旗)桌面版的4.0,不過我剛裝時,一插上U盤,就死機了,暈,還稱對U盤即插即用(P&P)。

前幾天,在網上看到linux在很低配置,也能實現3D桌面,於是乎,就刻碟裝linux。一開始裝的是Ubuntu 7.04,但是按網上的方法始終裝不好,其間實現了顫動的窗口,現在想想是那些貼沒講其中的一些細節。
搞了兩天,後來惱了,立馬刻碟裝 Fedora 7 ,當初不知道yum還有插件,升級了大半天,汗(電信的2M ADSL)。

建議其他新手,裝了系統之後,先裝YUM插件及其GUI:

在終端輸入如下:

$su

在輸入root的密碼,不顯示任何東東,如****沒有的

已經在root帳戶登入直接輸入

#yum -y install yum*

更新 yum 以及下載yum插件

有yumex(Yum Extender)這是GNOME桌面的YUM的GUI(圖形界面);

KDE桌面的是kyum,還要:
#yum -y install kyum。

添加/刪除軟體,即軟體包管理者,本質也是YUM的一個圖形前端(GUI),不過還是yumex最好用(在應用程序——>系統工具——>Yum Extender)。同一時刻只能運行一個YUM的。

重要的附帶說明:如果你在打開了,發現Yum Extender界面的菜單出現亂碼,請務必在再次登入的時候,選擇語言 ,中國 (UT-8),這是編碼的事,新手先不必理會(在本論壇的這個專題有文章說明的)

然後,在本專題搜索 添加Livna,fedora.cn的源。也可以在google,百度搜索的 。我發現國外的,各種專題的yum源比較多哦。

Compiz Fusion 是 Compiz 和 Beryl 合併后的新名稱。近期,經過開發者的努力開發,Compiz Fusion 為其帶來了四個新的插件:Atlantis、Colorfilter、Shift Window Switcher 和 Screensaver。看起來,有些插件所實現的效果真的蠻酷的。

按照Novell公司的官方標準,你只需要配備了GeForce 2級別的「史前顯卡」就可以享受到XGL的三維效果了。這就意味著,現在絕大多數的電腦用戶,包括那些使用集成顯卡的用戶,在開啟XGL效果的時候都可以不進行硬體的升級。

更酷的視覺效果,極低的硬體需求,你還能再要求什麼呢?

二。驅動

我是用ATI卡的,Nvidia卡,我就不說了。

這是紅聯上一篇關於驅動安裝的文章,現在就截ATI一部分說明

http://www.linuxdiyf.com/viewarticle.php?id=56768

Fedora 7 自帶的顯卡驅動程序功能相對比較差,而且開發還不夠完善。再加上 AMD(ATI) 在 Linux 驅動程序方面開發的敷衍態度,Fedora 自帶的 ATI 顯卡驅動程序非常糟糕,容易出現 3D 加速不能啟用、顯示花屏、滑鼠游標消失等各種各樣的問題。相對而言,Livna 的顯卡驅動程序質量就比較好,而且是它是專門為 Fedora 開發的,無論是功能還是兼容性都比較強。
  
  如果你用的是 ATI 顯卡,有官方的和 Livna 的驅動程序兩種選擇:

###################################
新手沒必要去編譯,先學會其他基本的東西再說。
###################################

  使用官方驅動程序:
  1. 先去 Softpedia 網站下載最新 ATI 的顯卡驅動程序,根據你的 CPU 和系統選擇合適的文件。比如支持 X86-64 的就下載的是「ati-driver-installer-8.39.4-x86.x86_64.run」,最好保存到「home」文件夾。

  2. 在剛才的終端窗口中,輸入「yum -y install kernel-devel rpm-build gcc」並回車,安裝系統核心源碼、RPM 構建包和 GCC,這些東西 Fedora 7 的「典型安裝」是不會安裝的,而官方驅動程序是沒有經過編譯的源碼,所以必須進行編譯。如果你已經安裝了,系統會自動進行升級。

  3. 安裝完成後,在終端中輸入「cd ~」並回車,以切換至「home」文件夾。然後輸入「sh ati-driver-installer-8.39.4-x86.x86_64.run --buildpkg Fedora/F7」並回車,系統開始編譯安裝程序。

  4. 輸入「rpm -ivh ATI-fglrx-8.39.4-1.f7.i386.rpm ATI-fglrx-control-center-8.39.4-1.f7.i386.rpm kernel-module-ATI-fglrx-2.6.21-1.3228.fc7-8.39.4-1.f7.i386.rpm」並回車,安裝驅動程序和控制中心,注意不同的安裝包編譯出來的包名字不一樣,可以用「ls」命令查看。

##########################
現在官方的ATI驅動不用像那樣麻煩了,在終端輸入#yum -y install kmod-fglrx glx-utils裡面它自己下載了。

實際上,要是多個源都使用的話,在下面的操作中官方的驅動也下回來了。
#######################

  使用 Livna 驅動程序:
  1. 在剛才的終端窗口中,輸入「yum -y install kmod-fglrx glx-utils」並回車。注意,如果你使用的是支持超線程技術的 CPU 或者雙核 CPU,請用「kmod-fglrx-smp」代替「kmod-fglrx」,不過絕大多數情況下 yum 會自動選擇合適的版本。

  打開一個終端,然後輸入「glxinfo | grep direct」並回車。如果顯示「Direct rendering: Yes」,則恭喜你,顯卡驅動程序已經能夠正常運行了。
############################
這個方法不科學,在XGL篇章可以看出來
###########################

  另外一種方法是:#fglrxinfo

[root@localhost ~]# fglrxinfo
Xlib: extension "XFree86-DRI" missing on display ":0.0".
display: :0.0 screen: 0
OpenGL vendor string: ATI Technologies Inc.
OpenGL renderer string: ATI RADEON 9600 Series
OpenGL version string: 1.2 (2.0.6747 (8.40.4))
這是我的顯卡9550卡,看到ATI 或者是Nvidia

附註:

glxgears:測試顯卡的性能,我在沒裝上之前是1600fps,裝上后是3700fps,性能提高好多

glxinfo | grep direct

fglrxinfo這是A卡專用的,當裝上驅動時才可以用

glxinfo

以上是顯示顯卡信息的


三。裝XGL

這個是XGL為fedora 5 6 7版 做好的RPM包
大家可以去下其他FC5.FC6版本的XGL
http://download.tuxfamily.org/fedoraxgl/
######################
新手不用看
喜歡暈的同學看這:
這是FC7 XGL yum的源
下回來雙擊,這樣XGL的源就加好了。
http://download.tuxfamily.org/fedoraxgl/xgl-release-7.noarch.rpm
可以用wget下:#wget http://download.tuxfamily.org/fedoraxgl/xgl-release-7.noarch.rpm
#rpm -ivh http://download.tuxfamily.org/fedoraxgl/xgl-release-7.noarch.rpm

附:rpm的用法:
http://www.linuxsir.org/main/?q=node/50
#####################
我配置的是32位CPU的,其他64位CPU和FC6 FC5等等的可以到http://download.tuxfamily.org/fedoraxgl/找相應的文件
關鍵詞是:system-config-xselector xorg-x11-server-Xgl

怎麼找呢,有時候文件名太長了,就沒顯示完全,這時候有兩個步驟:
1.把滑鼠放到文件名上,看瀏覽器狀態欄,下面一般就顯示出來了,除非你瀏覽器狀態欄禁顯了;
2.是在比較兩個文件文件名查不多,後面帶rpm是安裝軟體,

先把下面這兩個東東搞回來,可用工具下回來,然後按順序雙擊裝好。
1. http://download.tuxfamily.org/fe ... or-0.3-1.noarch.rpm

2. http://download.tuxfamily.org/fe ... 104git.fc7.i386.rpm

XGL的設置如圖見:

在應用程序——>系統工具——>Livan display configuration

附件的圖:

#glxinfo | grep direct

四。裝compiz 或者berly


compiz fusion 0.5.2+Fusion Icon


###################
以下是引用百度那位作者的話:
######################
在終端中,(su獲得root許可權)
cd /etc/yum.repos.d/
wget http://devel.foss.org.my/~kagesenshi/repo/pub/kagesenshi.repo
#########################
附註:在用wget之前先#yum -y installwget,當然也可以用axel,好像沒有RPM版的,我是現編譯的。不帶GUI的程序好編,出ATI顯卡編成功外,其他代GUI的我還沒成功過,我是newbie(新手)呢,於此同時,我發現YUM實際上不能很好解決文件依賴問題
#########################
然後:
(For GNOME Users)
yum -y install compiz-gnome compiz-fusion-plugins-main compiz-fusion-plugins-extra compizconfig-settings-manager fusion-icon-gtk emerald emerald-themes

(For Kde Users)
yum -y install compiz-kde compiz-fusion-plugins-main compiz-fusion-plugins-extra compizconfig-settings-manager fusion-icon-qt emerald emerald-themes

安裝完成後
Applications > System Tools > Fusion Icon
(應用程序》系統工具》Fusion Icon)

即可啟動compiz fusion特效了。
#####################
我不喜歡暈回來(yum),實在是太沒效率,還是手動下載快,
這個是網址:http://devel.foss.org.my/~kagesenshi/repo/pub/

我把找到的適應我32位CPU的版本在下面列出來了;在i386目錄下

64位CPU可以按照如下的關鍵詞找到:(在X86_64目錄下)

compiz compiz-fusion-plugins-main fusion-icon emerald emerald-themes ccsm

GNOME用戶再找:
compiz-gnome

KDE用戶再找:
compiz-kde
用yum的話就不用手動找了,yum是為低網速設計的,希望高手能給出,FC7 的yum使用wget或者axel配置修改方案。


這是我找到的適應我32位CPU的版本,安如下順序裝好即可:

gnome:

http://devel.foss.org.my/~kagese ... .2-0.1.fc7.i386.rpm
http://devel.foss.org.my/~kagese ... .2-0.1.fc7.i386.rpm
http://devel.foss.org.my/~kagese ... .2-0.2.fc7.i386.rpm
http://devel.foss.org.my/~kagese ... 4git.fc7.noarch.rpm
http://devel.foss.org.my/~kagese ... -0.1.fc7.noarch.rpm
http://devel.foss.org.my/~kagese ... 0.1git.fc7.i386.rpm
http://devel.foss.org.my/~kagese ... -0.1.fc7.noarch.rpm


KDE:

http://devel.foss.org.my/~kagese ... .2-0.1.fc7.i386.rpm
http://devel.foss.org.my/~kagese ... .2-0.1.fc7.i386.rpm
http://devel.foss.org.my/~kagese ... .2-0.2.fc7.i386.rpm
http://devel.foss.org.my/~kagese ... 4git.fc7.noarch.rpm
http://devel.foss.org.my/~kagese ... -0.1.fc7.noarch.rpm
http://devel.foss.org.my/~kagese ... 0.1git.fc7.i386.rpm
http://devel.foss.org.my/~kagese ... -0.1.fc7.noarch.rpm



berly:


直接yum啦
#yum -y install berly


我同時裝了berly和compiz fusion,現在用compiz fusion ,這將是未來的主流嘛

五。後記

在本論文結束之際,最後總結一下,實現fedora 實現3D桌面的方法:

1.裝完系統后,不裝ATI驅動,利用系統自帶的AIGLX,再加裝Compiz fusion或者berly實現3D桌面效果
公式1:AIGLX+Comupiz fusion
或者 AIGLX+berly
但是,這種情況下,性能低下,不推薦。

2.裝顯卡驅動后,在裝XGL后,再加裝Compiz fusion或者berly實現3D桌面效果
公式2:XGL+Comupiz fusion
或者 XGL+berly
推薦 :公式2:XGL+Comupiz fusion,理由我就不重訴了。

方法1見:文章主內容;
方法2:是利用shell腳本實現,我會在附錄中給腳本以及簡單的步驟。最簡單的方法,不過很沒速度的,大家試了就知道;反正,我的是沒什麼速度。
不過用國際代理的話,可能會快些,我還不會在linux用代理呢。所以沒試過,用代理嘗試過,請反饋一下。腳本是XGL+Comupiz fusion or berly
很方便的 ,FC5 FC6。可以試一試。

六。附錄

我的硬體配置:
CPU:CR2.4G
mainboard:MSI PT8,VIA PT800『chip
VPU:MSI 9550 128bit 64M OC 405/600-->rename asus
RAM:kingston 1G *1
Monitor:LG T711s CRT
Record driver:asus 1608s -->pioneer 111L
Mouse:logitech G5
keyboard:logitech New Touch Keyboard

引用的文章網址,我就不用重複給了吧。

我一開始就是按照方法一做的,在我昨天重裝了fedora 7,原因是在裝系統時候,讓它自動分區,它分的極不合理。2G做swap,真笨死了,1G的RAM不需要那麼多swap,還閑置了460M的硬碟空間;這一點做的就不如Ubuntu 7.04了,Ubuntu 7.04自動分了560M swap,還/boot,/。

後來,裝了cedega6.0.2(為了測玩魔獸,CS,魔獸世界),沒通過3D加速和Opengl的測試,就給系統裝顯卡驅動,結果,3D功能用不了,不過在驅動用#glxgears,檢測后,顯卡性能大增,正如前面說的-----Fedora 自帶的 ATI 顯卡驅動程序非常糟糕,容易出現 3D 加速不能啟用、顯示花屏、滑鼠游標消失等各種各樣的問題。

現在給出我的/etc/X11/xorg.conf內容

Livan display configuration生成的,不用手工改,比較方便吧,我手工也會,這裡面的含義簡單的很。看看man 就知道怎麼手工該了。

# Xorg configuration created by system-config-display

Section "ServerLayout"
Identifier "single head configuration"
Screen 0 "Screen0" 0 0
InputDevice "Keyboard0" "CoreKeyboard"
EndSection

Section "Files"
ModulePath "/usr/lib/xorg/modules"
EndSection

Section "ServerFlags"
Option "AIGLX" "off"
EndSection

Section "InputDevice"
Identifier "Keyboard0"
Driver "kbd"
Option "XkbModel" "pc105"
Option "XkbLayout" "us"
EndSection

Section "Monitor"
Identifier "Monitor0"
ModelName "Monitor 1024x768"
HorizSync 31.5 - 57.0
VertRefresh 50.0 - 70.0
Option "dpms"
EndSection

Section "Device"
Identifier "Videocard0"
Driver "fglrx"
Option "OpenGLOverlay" "off"
Option "VideoOverlay" "on"
Option "PseudoColorVisuals" "off"
EndSection

Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
SubSection "Display"
Viewport 0 0
Depth 24
EndSubSection
EndSection

Section "Extensions"
Option "Composite" "Disable"
EndSection


下面是腳本內容,複製到個空文檔,取名installXGL
然後CD到該文檔目錄
#sh installXGL
照提示就可以了,下面是英文原檔:
英文簡單的很,我就不譯,有人感興趣的話,就譯一下吧。

裡面還有FC5 FC6 安裝的腳本。FC5,FC6用戶可以試一試。


http://nicofo.tuxfamily.org/dotc ... and-beryl-on-fedora

#!/bin/sh
#
# nicofo - http://nicofo.tuxfamily.org
# Automatic installation and configuration of xgl for GNOME, KDE and XFCE
#
# English version. Original is at
# http://nicofo.tuxfamily.org/scripts/xgl/installXGL
#
# 20/01/07 - version 1
# 06/02/07 - version 2 Mis à jour pour pouvoir faire des updates
# 08/03/07 - version 3 Possibilité de désinstaller
# 01/04/07 - version 4 Architectures x86_64
# 01/06/07 - version 5 Nouvelle version de XGL pour FC6 :
# utilise les versions officielles de compiz et beryl
# 21/06/07 - version 6 N'utilise plus xgl-info
# 22/06/07 - version 7 Pour Fedora 7 également
# 09/08/07 - version 8 Compiz-fusion


testRoot()
{
if [ $(id -u) -ne 0 ]; then
echo -e "The installation and configuration of XGL must be run as \033[1mroot\033[0m."
exit 1
fi
}

#supprime les anciens fichiers de config
clearOldVersion()
{
rm -f /usr/sbin/xgl-info
rm -f /etc/xgl/xgl-hardware-list
rmdir /etc/xgl 2>/dev/null
}

msg()
{
if [ $# -ge 2 ] && [ "$1" = "-n" ]; then
echo -en "\n\033[1;34m$2\033[0m"
else
echo -e "\n\033[1;34m$1\033[0m"
fi
}

#Désinstalle compiz
removeCompiz()
{
if [ -f /usr/bin/gset-compiz ]; then
rpm -e gset-compiz
rmdir /usr/lib/compiz 2>/dev/null #version 64 bits
fi
yum remove compiz
}

#Désinstalle compiz-fusion
removeFusion()
{
rm /etc/yum.repos.d/kagesenshi.repo
[ -f /usr/bin/beryl ] && msg "The version of emerald compatible with Beryl will be reinstalled next..."
yum remove compiz\* fusion-icon\* emerald\* libcompizconfig
[ -f /usr/bin/beryl ] && yum install emerald-themes emerald
}

#Désinstalle beryl
removeBeryl()
{
yum remove beryl\*
}

#Demande s'il faut désinstaller compiz (fusion) et beryl
removeCompizBeryl()
{
[ $# -eq 0 ] && seq=0 || seq=$1

#Supprimer Compiz (fusion) :
if [ -f /usr/bin/compiz ]; then
seq=$(($seq+1))
rpm -q compiz-fusion-plugins-main>/dev/null && add="-fusion"
msg -n "$seq) Do you want to remove Compiz$add [y/N] ? "
read res
if [ "$res" == "y" ] || [ "$res" == "Y" ]; then
[ "$add" = "-fusion" ] && ( removeFusion || [ 1 ] ) || removeCompiz
fi
fi

#Supprimer Beryl :
if [ -f /usr/bin/beryl ]; then
seq=$(($seq+1))
msg -n "$seq) Do you want to remove Beryl [y/N] ? "
read res
if [ "$res" == "y" ] || [ "$res" == "Y" ] ;then
removeBeryl
fi
fi
}

#Demande s'il faut installer compiz (fusion) et beryl
installCompizBeryl()
{
rpm -q compiz-fusion-plugins-main>/dev/null
[ -f /usr/bin/compiz -a $? -eq 0 ] && F=1 || F=0
[ -f /usr/bin/compiz -a $F -eq 0 ] && C=1 || C=0 #1 ==> compiz déjà installé
[ -f /usr/bin/beryl ] && B=1 || B=0

IC=0 #1=install compiz
IF=0
IB=0

RC=0 #1=remove compiz
RF=0

echo -en "\n\033[1m[1/2] Compiz - Compiz-fusion (Fedora 7 only)\033[0m"
if [ $B -eq 1 ] && [ $F -eq 0 ]; then
echo -en "\n\033[4mRemark\033[0m: Beryl is already installed. If you decide to install Compiz-fusion, it\nwill remain possible to use Beryl provided that you use another window decorator\nthan emerald."
fi
if [ $C -eq 1 ] && [ $F -eq 0 ]; then
msg -n "Do you want to replace Compiz with \033[31mCompiz-fusion\033[1;34m [Y/n] ? "
read res
[ ! "$res" == "n" ] && [ ! "$res" == "N" ] && IF=1 && RC=1
elif [ $C -eq 0 ] && [ $F -eq 1 ]; then
msg -n "Do you want to replace Compiz-fusion with \033[31mCompiz\033[1;34m [y/N] ? "
read res
[ "$res" == "y" -o "$res" == "Y" ] && IC=1 && RF=1
else #ni compiz ni compiz-fusion installés
msg -n "Do you want to install \033[31mCompiz-fusion\033[1;34m or \033[31mCompiz\033[1;34m ?
Compiz-fusion [1] (default)
Compiz [2]
(nothing) [3]
\r> "
read res
[ "$res" = 2 ] && IC=1
[ ! "$res" = 2 ] && [ ! "$res" = 3 ] && IF=1
fi

echo -en "\n\033[1m[2/2] Beryl\033[0m"
if [ $B -eq 1 ]; then
msg "Beryl is already installed."
else
if [ $F -eq 1 ] && [ $RF -eq 0 ] || [ $IF -eq 1 ]; then
echo -en "\n\033[4mRemark\033[0m: Compiz-fusion is already installed. If you decide to install Beryl as\nwell, you will have to use another window decorator than emerald for Beryl."
fi
msg -n "Do you want to install Beryl [Y/n] ? "
read res
[ ! "$res" == "n" ] && [ ! "$res" == "N" ] && IB=1
fi

seq=0
#Désinstaller
if [ $RC -eq 1 ]; then
seq=$(($seq+1))
msg "$seq) Removing Compiz..."
removeCompiz
fi
if [ $RF -eq 1 ]; then
seq=$(($seq+1))
msg "$seq) Removing Compiz-fusion..."
removeFusion
fi

#Installer
KDE=0
GNOME=0
rpm -q kdebase >/dev/null && KDE=1 || GNOME=1
rpm -q gnome-session >/dev/null && GNOME=1
if [ $IF -eq 1 ]; then
seq=$(($seq+1))
msg "$seq) Installation of Compiz-fusion..."

wget http://devel.foss.org.my/~kagesenshi/repo/pub/kagesenshi.repo -O /etc/yum.repos.d/kagesenshi.repo
fusion_com="compiz-fusion-plugins-main compiz-fusion-plugins-extra compizconfig-settings-manager emerald emerald-themes"
[ $KDE -eq 1 ] && fusion_kde="compiz-kde fusion-icon-qt"
[ $GNOME -eq 1 ] && fusion_gnome="compiz-gnome fusion-icon-gtk"
yum install $fusion_com $fusion_kde $fusion_gnome

#sed -i "s#icon = gtk.status_icon_new_from_icon_name('fusion-icon')#icon = gtk.status_icon_new_from_file('/usr/share/icons/hicolor/scalable/apps/fusion-icon.svg')#" /usr/share/fusion-icon/interface_gtk.py
fi

if [ $IC -eq 1 ]; then
seq=$(($seq+1))
msg "$seq)Installation of Compiz..."
yum install compiz
fi
IG=0 #install gset-compiz
if [ -f /usr/bin/compiz ] && ! rpm -q compiz-fusion-plugins-main>/dev/null && [ ! -f /usr/bin/gset-compiz ]; then
msg "Do you want to install 'gset-compiz' (FC5 version) which allows to configure\ncompiz ? [y/N]"
read res
[ "$(arch)" = "x86_64" ] && ARCH=x86_64 || ARCH=i386
[ "$res" == "y" -o "$res" == "Y" ] && rpm -Uhv http://nicofo.tuxfamily.org/scri ... z-0.3.3-1.$ARCH.rpm && IG=1
[ "$ARCH" = "x86_64" ] && [ -f /usr/bin/gset-compiz ] && mkdir /usr/lib/compiz #sinon bug en 64 bits
fi

if [ $IB -eq 1 ]; then
seq=$(($seq+1))
msg "$seq) Installation of Beryl..."
[ $KDE -eq 1 ] && beryl_kde="beryl-kde"
[ $GNOME -eq 1 ] && beryl_gnome="beryl-gnome"
yum install $beryl_kde $beryl_gnome
fi

[ $(($IF+$IC+$IB+$IG)) -eq 0 ] && return -2 || return 0 #-2 : on a demandé de ne rien installer
}

if [ $# -ge 1 ]; then
if [ $1 = "-r" ] || [ $1 = "--remove" ]; then
testRoot

#Déconfigurer XGL :
msg "1) Removing configuration files... "
wget http://nicofo.tuxfamily.org/scripts/xgl/xgl-settings.tar.gz -O xgl-settings.tar.gz
tar -xzf xgl-settings.tar.gz configureXgl
sh configureXgl -r
rm -f configureXgl xgl-settings.tar.gz

#Supprimer les RPM installés :
msg "2) Uninstall XGL..."
rpm -e xorg-x11-server-Xgl --noscripts
clearOldVersion

if [ -z "$(rpm -e glitz-glx glitz --test 2>&1)" ]; then
rpm -e glitz-glx glitz
fi

seq=2
removeCompizBeryl $seq

echo -e "\n\033[1mUninstallation finished.\033[0m"
elif [ $1 = "-cb" ] || [ $1 = "-bc" ]; then
testRoot
installCompizBeryl
elif [ $1 = "-rcb" ] || [ $1 = "-rbc" ]; then
testRoot
removeCompizBeryl
else
echo "Usage:"
echo " $(basename $0) install and configure XGL / update XGL"
echo " $(basename $0) -r|--remove uninstall XGL"
echo " $(basename $0) -cb propose to install compiz(-fusion) and beryl"
echo " $(basename $0) -rcb propose to remove compiz(-fusion) and beryl"
fi
exit 0
fi

testRoot

texte=(
"Installation check"
"Download of XGL"
"Installation of XGL"
"Configuration of XGL"
"Installation of Compiz and Beryl"
)

N=${#texte
  • } #nombre total d'étapes = nombre d'éléments dans $texte (ou : ${#texte[@]})
    n=0 #étape actuelle (à partir de 0)

    #$etat = status de l'étape précédente
    #0=OK ; autre=KO ; -1=STOP ; -2=so (sans objet)
    etat=0
    erreur=""

    avant="\033[2m"
    actuel="\033[1;5;33;42m"
    apres="\033[1;34m"
    normal="\033[m"
    ok="\033[1;32m[ OK ]\033[0m"
    ko="\033[1;31m[ KO ]\033[0m"
    so="\033[1;36m[Alrdy done]\033[0m"

    stop()
    {
    echo
    echo -e "\033[31m$erreur\033[0m"
    read -p "Installation cannot continue. Do you want to continue anyway [y/N] ? " res
    if [ ! "$res" == "y" ] && [ ! "$res" == "Y" ] ;then
    exit $n
    fi
    echo
    etat=1
    erreur=""
    }

    menu()
    {
    #status : 0=OK ; autre=KO ; -1=STOP ; -2=so (sans objet)
    if [ $n -gt 0 ]; then
    status[$((n-1))]=$etat
    fi

    if [ $etat -eq -1 ]; then
    stop
    elif [ -n "$erreur" ]; then
    echo -e "\033[31m$erreur\033[0m"
    fi

    clear

    for i in $(seq 0 $(($N-1))); do
    if [ $i -lt $n ]; then
    echo -en $avant
    elif [ $i -eq $n ]; then
    echo -en $actuel
    else
    echo -en $apres
    fi

    echo -n "$(($i+1))) ${texte[$i]}"

    if [ $i -lt $n ]; then
    echo -en "\033[500C\033[15D$normal" #fin ligne
    if [ ${status[$i]} -eq 0 ]; then
    echo -e "$ok"
    elif [ ${status[$i]} -eq -2 ]; then
    echo -e "$so"
    else
    echo -e "$ko"
    fi
    else
    echo -e "$normal"
    fi
    done
    n=$(($n+1))
    echo ; echo

    erreur=""
    etat=0
    }


    #Vérif. de l'installation
    menu
    etat=-2

    #détermination de la version de Fedora et de l'architecture
    ARCH=$(uname -m)
    [ ! "$ARCH" = "x86_64" ] && ARCH=i386

    FED_VERSION=$(more /etc/fedora-release |sed "s/^.* \([0-9]\+\) (.*)$/\1/")
    [ -z $(echo $FED_VERSION |grep "^[0-9]\+$") ] && msg "Error while determining the version of Fedora" && exit

    echo "Version of Fedora : $FED_VERSION"
    echo "Architecture : $ARCH"

    if [ ! $FED_VERSION -ge 6 ]; then
    msg "This installation script of xgl is valid for a version of Fedora > 5."
    if [ $FED_VERSION -eq 5 ]; then
    msg -n "For Fedora 5, use \033[4minstallXGL_FC5_EN"
    msg "\thttp://nicofo.tuxfamily.org/scripts/xgl/installXGL_FC5_EN"
    fi
    exit
    fi

    if [ "$(rpm -q xorg-x11-server-Xgl)" = "xorg-x11-server-Xgl-1.1.99.1-3" ]; then
    msg "Removal of the old version of XGL\n\t(you do not need to remove Beryl) [ENTER]"
    read res
    wget http://nicofo.tuxfamily.org/scripts/xgl/installXGL_FC5_EN -O installXGL_old
    sh installXGL_old -r
    rm installXGL_old
    etat=0
    fi

    for DEP in zenity xorg-x11-fonts-base ; do
    if ! rpm -q $DEP>/dev/null; then
    msg "Dependency installation: $DEP"
    yum install $DEP
    etat=0
    fi
    done

    clearOldVersion


    #Téléchargement de XGL
    #version actuelle de XGL :
    version_xgl=$(rpm -q xorg-x11-server-Xgl)
    DJ_INST=$? #0 ==> déjà installé
    if [ $DJ_INST -eq 0 ]; then
    texte[$n]="Check for updates of XGL and download"
    fi
    menu
    #SITE_XGL="http://files.damaestro.us/xgl/" # (old FC6)
    #NOM_SETTINGS="Xgl-settings" # (old FC6)
    SITE_XGL="http://download.tuxfamily.org/fedoraxgl/$FED_VERSION/$ARCH/" #site des RPM
    NOM_SETTINGS="system-config-xselector" #nom du RPM de configuration
    wget $SITE_XGL -O xgl.html
    if [ $? -eq 0 ]; then
    # rpm_xgl=$(grep "xorg-x11-server-Xgl-[0-9][^\"]*.$ARCH.rpm" xgl.html -o|sort -ur|head -n 1)
    # rpm_xgl_set=$(grep "$NOM_SETTINGS-[0-9][^\"]*.noarch.rpm" xgl.html -o|sort -ur|head -n 1)
    rpm_xgl=$(grep "xorg-x11-server-Xgl-[0-9][^\"]*.$ARCH.rpm" xgl.html -o|tail -n 1)
    rpm_xgl_set=$(grep "$NOM_SETTINGS-[0-9][^\"]*.noarch.rpm" xgl.html -o|tail -n 1)

    rm xgl.html

    if [ -n "$rpm_xgl" ] && [ -n "$rpm_xgl_set" ]; then
    # vérifier si il y a une màj disponible
    if [ $DJ_INST -eq 0 ]; then
    #derniere_version=$(echo -e \
    # "$(echo "$rpm_xgl"|sed "s/\.[^\.]*\.*rpm$//")\n$version_xgl"| \
    # sort -r|head -n 1)
    derniere_version=$(echo "$rpm_xgl"|sed "s/\.[^\.]*\.*rpm$//")
    if [ $derniere_version = $version_xgl ]; then
    etat=-2
    msg "The installed version of XGL ($derniere_version) is already the last one."
    else
    texte[$n]="Update of XGL"
    msg "An update of XGL is available \
    \n\told version : $version_xgl \
    \n\tnew version : $derniere_version\n"
    fi
    fi
    else
    erreur="rpm of XGL not found at $SITE_XGL !"
    [ $DJ_INST -eq 0 ] && etat=1 || etat=-1
    fi
    else
    erreur="An error occured with the site of the XGL's rpm ($SITE_XGL)."
    [ $DJ_INST -eq 0 ] && etat=1 || etat=-1
    fi
    #téléchargement
    if [ $etat -eq 0 ]; then
    wget -c $SITE_XGL$rpm_xgl
    wget -c $SITE_XGL$rpm_xgl_set
    if [ ! -f $rpm_xgl ] || [ ! -f $rpm_xgl_set ]; then
    erreur="Error while downloading '$rpm_xgl' or '$rpm_xgl_set'."
    [ $DJ_INST -eq 0 ] && etat=1 || etat=-1
    else
    INSTALL_XGL=1
    fi
    fi


    #Installation de XGL
    menu
    if [ ! "$INSTALL_XGL" = "1" ]; then
    INSTALL_XGL=0
    etat=-2
    else

    if ! rpm -q glitz-glx>/dev/null; then
    yum -y install glitz-glx
    if [ $? -ne 0 ]; then
    erreur="Error while installing the dependencies (glitz-glx) of XGL."
    stop
    fi
    fi

    rpm -Uhv $rpm_xgl $rpm_xgl_set --test >/dev/null 2>&1
    if [ $? -eq 0 ]; then
    rpm -Uhv $rpm_xgl $rpm_xgl_set --noscripts
    installOK=$?
    else
    msg "Dependencies are needed to install XGL:"
    [ $FED_VERSION -ge 7 ] && YUM_OPT="--nogpgcheck" || YUM_OPT=""
    yum install $rpm_xgl $rpm_xgl_set $YUM_OPT

    rpm -q xorg-x11-server-Xgl>/dev/null
    installOK=$?
    fi
    if [ $installOK -ne 0 ] ; then
    etat=-1
    erreur="Error at the installation of the RPM of XGL."
    else
    rm -f $rpm_xgl $rpm_xgl_set
    rpm -e --nodeps $NOM_SETTINGS
    fi
    fi


    #Configuration de XGL
    menu
    wget http://nicofo.tuxfamily.org/scripts/xgl/xgl-settings.tar.gz -O xgl-settings.tar.gz
    if [ ! -s xgl-settings.tar.gz ]; then
    erreur="Error while downloading 'http://nicofo.tuxfamily.org/scripts/xgl/xgl-settings.tar.gz'."
    etat=-1
    else
    tar -xzf xgl-settings.tar.gz


    #traduction en anglais de 'chooseCompositeWM'
    FR=(
    "(avec"
    "(sans"
    "(Aucun gestionnaire de fenêtres composite)"
    "Gestionnaire de fenêtres avec XGL"
    "Quel gestionnaire de fenêtres voulez-vous avec XGL ?"
    "--column=\"Gestionnaire de fenêtres\""
    "\"\(.*\) n'est pas installé.* avec \([^ ]\+\) :"
    "installXGL"
    "Voulez-vous appliquer la.*session."
    "XGL n'est.*session XGL."
    )

    EN=(
    "(with"
    "(without"
    "(No composite window manager)"
    "Composite window manager with XGL"
    "Which composite window manager do you want with XGL ?"
    "--column=\"Window manager\""
    "\"\1 is not installed ! \\\nYou can easily install it using \2:"
    "installXGL_EN"
    "Do you want to apply the modification now ?\\\n\\\nOtherwise, the modification will take place with the next starting of your session."
    "XGL is not running.\\\n\\\nThe modification will take place with the next starting of your XGL session."
    )

    i=0
    for fr in "${FR[@]}"; do
    # echo "$fr -> ${EN[$i]}"
    sed -i "s/$fr/${EN[$i]}/g" chooseCompositeWM
    i=$(($i+1))
    done


    ./configureXgl
    if [ $? -ne 0 ]; then etat=-1; fi
    rm -f xgl-settings.tar.gz $(tar -tf xgl-settings.tar.gz)
    fi


    #Installation de Beryl et Compiz
    menu
    if [ $DJ_INST -ne 0 -a $INSTALL_XGL -eq 1 ] || [ ! -f /usr/bin/beryl -a ! -f /usr/bin/compiz ] ; then #1ère install XGL ou compiz et beryl non installés
    installCompizBeryl
    etat=$?
    else
    etat=-2
    fi


    #Fin
    menu
    echo -e "You can now install \033[1mCompiz\033[0m, \033[1mCompiz-fusion\033[0m or \033[1mBeryl\033[0m with"
    echo -e "\t\033[0;34m$(basename $0) -cb\033[0m\n\n"
    echo -e "Installation finished. You can now launch a new GNOME, KDE or XFCE session and\nchoose \033[1mXGL\033[0m."
    echo -e "At any time you can choose to use \033[1mCompiz\033[0m or \033[1mBeryl\033[0m through the Gnome/KDE menu -> Preferences/Settings -> \"XGL Window Manager\"."

  • [火星人 ] Fedora 7 ATI 顯卡 3D桌面的實現已經有586次圍觀

    http://coctec.com/docs/linux/show-post-169141.html