#!/bin/bash source /etc/functions.magic ### # Xserver 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 clear echo "Gentoox Xserver install script" sleep 5 $busy clear if [ ! -z `cat /etc/conf.d/magic-database | grep xfree-patch1 | tail -n 1` ]; then echo "Removing Xfree..." emerge -C virtual/x11 cat /etc/conf.d/magic-database | grep -v xfree-patch1 > /etc/conf.d/magic-database.tmp mv /etc/conf.d/magic-database.tmp /etc/conf.d/magic-database chmod 600 /etc/conf.d/magic-database rm -rf /etc/X11/XF86Config rm -rf /etc/XF86Config* fi echo "Clearing out old X..." sleep 5 emerge -C xorg-x11 if [ -d /etc/X11/xkb ]; then rm -rf /etc/X11/xkb fi if [ -d /usr/lib/X11/xkb ]; then rm -rf /usr/lib/X11/xkb fi clear cat /etc/make.conf | grep -v VIDEO_CARDS > /etc/make.conf2 cat /etc/make.conf2 | grep -v INPUT_DEVICES > /etc/make.conf rm -rf /etc/make.conf2 echo "VIDEO_CARDS=\"nv\"" >> /etc/make.conf echo "INPUT_DEVICES=\"evdev keyboard mouse joystick\"" >> /etc/make.conf chmod 644 /etc/make.conf chown root:root /etc/make.conf echo "About to emerge X..." sleep 5 ### # emerge X ### emerge xorg-x11 failCheck emerge $busy echo "Emerge X complete..." # Link in bin directory. if [ ! -e /usr/bin/X11 ]; then ln -sf /usr/bin /usr/bin/X11 1> /dev/null 2> /dev/null fi sleep 5 echo "Emerge jpeg..." sleep 2 emerge jpeg failCheck emerge clear echo "About to apply patches and configurations..." sleep 5 ### # Fix the config file with an Xbox modeline specific one ### mkdir /tmp/xorg -p cd /tmp/xorg $downloading $wget --limit-rate=$limitrate $gentooxurl/patch-files/xorg.tbz2 failCheck download $busy tar -jxvf xorg.tbz2 failCheck decompress rm -rf /etc/X11/XF86Config rm -rf /etc/X11/xorg.conf ### # Incompatible nvidia module removed and a working one downloaded ### rm -rf /etc/nv_drv.o.works cp ./nvxbox_drv.so /etc/nvxbox_drv.o.works mv ./nvxbox_drv.so /usr/lib/xorg/modules/drivers/nvxbox_drv.so mv ./nvxbox_drv.so /usr/lib/xorg/modules/drivers/nvxbox_drv.o ln -sf /usr/lib/xorg/modules/drivers/nvxbox_drv.o /usr/lib/xorg/modules/drivers/nvxbox_drv.so cd / rm -rf /tmp/xorg ### # Mouse functionality ### sleep 5 env-update source /etc/profile clear rm -rf /home/gentoox/.startx ### # Make TWM start automatically for each user and future users ONLY if XFCE # is not installed. ### if [ -z `cat /home/gentoox/.xinitrc | grep -m1 "twm" | awk '{ print $1 }'` ] && [ -z `cat /etc/conf.d/magic-database | grep -m1 "xfce-patch"` ]; then echo "twm" >> /home/gentoox/.xinitrc echo "twm" >> /root/.xinitrc echo "twm" >> /etc/skel/.xinitrc fi