#!/bin/bash source /etc/functions.magic ### # Display tools installation script # Copyright (C) Thomas "ShALLaX" Pedley (gentoox@shallax.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ### $important DRIVERMD5="3bcd767fa39ac0fb665baadd86986c0a" clear echo "This package installs various tools and addons that affect the display." echo "Included is xbvset, vnc support for Xserver (only if X is installed)," echo "the Xbox nvidia driver for X, xorg.conf files for different setups," echo "and scrollwheel support for X." sleep 10 cd /bin $busy if [ ! -z `grep -m1 -i xserver-patch /etc/conf.d/magic-database` ]; then ### # Disable the old vncserver script then delete it # No need for that old junk anymore ;) ### if [ -f /etc/init.d/vnc ]; then echo "Disabling old VNC scripts..." sleep 2 rc-update del vnc default 1> /dev/null 2> /dev/null rm -rf /etc/init.d/vnc rm -rf /bin/vncctl rm -rf /home/gentoox/.vncstart rm -rf /home/gentoox/.vncstop fi ### # If you've not got TightVNC, you do now ;) ### if [ ! -f /usr/share/tightvnc/classes/index.vnc ]; then echo "Ensuring vnc is not installed..." emerge -C vnc echo "Emerging TightVNC..." sleep 2 emerge tightvnc failCheck emerge $busy fi ### # Get the password file, the password is: gentoox ### if [ ! -f /home/gentoox/.vnc/passwd ]; then mkdir -p /home/gentoox/.vnc/ cd /home/gentoox/.vnc/ $downloading rm -rf /home/gentoox/.vnc/passwd.vnc $wget --limit-rate=${limitrate} $gentooxurl/patch-files/passwd.vnc failCheck download $busy mv /home/gentoox/.vnc/passwd.vnc /home/gentoox/.vnc/passwd chown -R gentoox:users /home/gentoox/.vnc chmod 644 /home/gentoox/.vnc/passwd fi ### # Install the VNC module for X ### cd /usr/X11R6/lib/modules/extensions rm -rf /usr/X11R6/lib/modules/extensions/vnc.so* $busy clear echo "Uninstalling xf4vnc..." sleep 2 emerge -C xf4vnc failCheck emerge clear echo "Installing x11vnc..." sleep 2 emerge x11vnc failcheck emerge cd /etc/init.d rm -rf ./x11vnc $downloading $wget --limit-rate=$limitrate $gentooxurl/patch-files/x11vnc failCheck download $busy chown root:root ./x11vnc chmod 700 ./x11vnc fi cd /etc/ ### # Get xbvset ### rm -rf /etc/xbvset.tbz2* $downloading $wget --limit-rate=$limitrate $gentooxurl/patch-files/xbvset.tbz2 failCheck download $busy tar -jxvf /etc/xbvset.tbz2 failCheck decompress rm -rf /etc/xbvset.tbz2* mv /etc/xbvset /bin/xbvset mv /etc/video /bin/video mv /etc/fbset.rc /etc/init.d/fbset mv /etc/fbset.conf /etc/conf.d/fbset chmod 755 /bin/video chmod 755 /etc/init.d/fbset chmod 644 /etc/conf.d/fbset chown root:root /bin/video chown root:root /bin/xbvset chmod +s /bin/video chown root:root /etc/init.d/fbset chown root:root /etc/conf.d/fbset rm -rf /etc/xbv ### # Working nvxbox_drv and Xorg executable are downloaded so if X gets updated, # xbvset only needs to be run to fix it! ### if [ -f /etc/nvxbox_drv.o.works ]; then if [ `md5sum /etc/nvxbox_drv.o.works | awk '{ print $1 }'` != "${DRIVERMD5}" ]; then DOWNLOADDRIVER="true" else DOWNLOADDRIVER="false" fi else DOWNLOADDRIVER="true" fi if [ "${DOWNLOADDRIVER}" == "true" ]; then cd /etc $downloading $wget --limit-rate=$limitrate $gentooxurl/patch-files/xorg.tbz2 failCheck download $busy tar -jxvf xorg.tbz2 mv /etc/nvxbox_drv.o /etc/nvxbox_drv.o.works rm -rf /etc/xorg.tbz2 fi cd /bin rm -rf /bin/tokde* $busy if [ ! -z `grep -m1 -i xfce-patch3 /etc/conf.d/magic-database` ]; then rm -rf /bin/toxfce $downloading $wget --limit-rate=$limitrate $gentooxurl/patch-files/toxfce failCheck download $busy rm -rf /bin/toxfcelaunch $downloading $wget --limit-rate=$limitrate $gentooxurl/patch-files/toxfcelaunch failCheck download else rm -rf /bin/toxfce* fi $busy chmod 755 /bin/toxfce* 1> /dev/null 2> /dev/null cd /home/gentoox rm -rf /home/gentoox/.reboot $downloading $wget --limit-rate=$limitrate $gentooxurl/patch-files/.reboot failCheck download $busy rm -rf /home/gentoox/.shutdown $downloading $wget --limit-rate=$limitrate $gentooxurl/patch-files/.shutdown failCheck download $busy chown gentoox:users /home/gentoox/.reboot chown gentoox:users /home/gentoox/.shutdown chmod 755 /home/gentoox/.reboot chmod 755 /home/gentoox/.shutdown clear