Fedora 7 自帶的顯卡驅動程序功能相對比較差,而且開發還不夠完善。再加上 AMD(ATI) 在 Linux 驅動程序方面開發的敷衍態度,Fedora 自帶的 ATI 顯卡驅動程序非常糟糕,容易出現 3D 加速不能啟用、顯示花屏、滑鼠游標消失等各種各樣的問題。相對而言,Livna 的顯卡驅動程序質量就比較好,而且是它是專門為 Fedora 開發的,無論是功能還是兼容性都比較強。
後來,裝了cedega6.0.2(為了測玩魔獸,CS,魔獸世界),沒通過3D加速和Opengl的測試,就給系統裝顯卡驅動,結果,3D功能用不了,不過在驅動用#glxgears,檢測后,顯卡性能大增,正如前面說的-----Fedora 自帶的 ATI 顯卡驅動程序非常糟糕,容易出現 3D 加速不能啟用、顯示花屏、滑鼠游標消失等各種各樣的問題。
#!/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 }
#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 }
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..."
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 -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\"."