ATI+Compiz Fusion 自动安装脚本
出于兴趣,想写个自动安装ATI显卡+Compiz Fusion的脚本。
今天一边上班一边忙着写,稍微有点雏形。
此脚本目前不建议大家使用,有兴趣的朋友可以帮忙排错。暂时还未加入容错能力。只是一个简单的架构:
#!/bin/bash
apt-get remove -y compiz-plugins compiz-core desktop-effects
apt-get update
#apt-get -y upgrade
#判断restricted包是否安装
resline=`dpkg -l linux-restricted-modules-$(uname -r) | grep linux | wc -l`
if [ "$resline" -eq "0" ];
then
#若未安装,则安装后重启
apt-get -y install linux-restricted-modules-$(uname -r)
echo “Please reboot your system and rerun this again.”
exit
else
fglrxline=`dpkg -l xorg-driver-fglrx | grep fglrx | wc -l`
if [ "$fglrxline" -eq "0" ];
then
#若未安装fglrx驱动,则安装后重启
apt-get -y install xorg-driver-fglrx
sed -i ’s/ati/fglrx/g’ /etc/X11/xorg.conf
echo “Please reboot your system and rerun this again.”
echo ‘Section “Extensions”‘ >> /etc/X11/xorg.conf
echo ‘Option “Composite” “0″‘ >> /etc/X11/xorg.conf
echo ‘EndSection’ >> /etc/X11/xorg.conf
echo ‘Section “ServerFlags”‘ >> /etc/X11/xorg.conf
echo ‘Option “AIGLX” “off”‘ >> /etc/X11/xorg.conf
echo ‘EndSection’
else
echo “Please Check Your Flgrx Driver,It’s not work.”
exit
fi
fi
touch /usr/local/bin/startxgl.sh
echo ‘#!/bin/sh’ >> /usr/local/bin/startxgl.sh
echo ‘Xgl :1 -fullscreen -ac -accel xv:pbuffer -accel glx:pbuffer &’ >> /usr/local/bin/startxgl.sh
echo ‘DISPLAY=:1′ >> /usr/local/bin/startxgl.sh
echo ‘cookie=”$(xauth -i nextract - :0 | cut -d ‘ ‘ -f 9)”‘ >> /usr/local/bin/startxgl.sh
echo ‘xauth -i add :1 . “$cookie”‘ >> /usr/local/bin/startxgl.sh
echo ‘exec dbus-launch –exit-with-session gnome-session’ >> /usr/local/bin/startxgl.sh
chmod a+x /usr/local/bin/startxgl.sh
touch /usr/share/xsessions/xgl.desktop
echo ‘[Desktop Entry]‘ >> /usr/share/xsessions/xgl.desktop
echo ‘Encoding=UTF-8′ >> /usr/share/xsessions/xgl.desktop
echo ‘Name=Compiz Fusion’ >> /usr/share/xsessions/xgl.desktop
echo ‘Comment=Start an Compiz Fusion Session’ >> /usr/share/xsessions/xgl.desktop
echo ‘Exec=/usr/local/bin/startxgl.sh’ >> /usr/share/xsessions/xgl.desktop
echo ‘Icon=’ >> /usr/share/xsessions/xgl.desktop
echo ‘Type=Application’ >> /usr/share/xsessions/xgl.desktop
wget -q http://down.linuxblog.cn/3v1deb/DD800CD9.gpg -O- | sudo apt-key add -
echo ‘deb http://down.linuxblog.cn/3v1deb/ feisty eyecandy’ >> /etc/apt/sources.list
apt-get autoremove -y compiz-core desktop-effects
apt-get update
apt-get upgrade
apt-get -y install xserver-xgl compiz compiz-gnome compizconfig-settings-manager compiz-fusion-plugins-extra compiz-fusion-plugins-unofficial libcompizconfig-backend-gconf
很棒啊!我要学习一下怎么写。
把脚本与站里的源结合起来了,实在方便了需要的人。建议完工后发到Ubuntu中文论坛上,哈哈。
呵呵 不难的 其实结构还不太好 最好可以全部用函数写
很好。很强大~
支持,有一个叫Envy的通用显卡驱动安装脚本,提供给latteye作参考。另外这个脚本好像在kde下不行。
我现在还在慢慢折腾我的Ubuntu呢~
呵呵