From 43dc115c52051cba208f93db8a15aecef11740cb Mon Sep 17 00:00:00 2001 From: Kolan Sh Date: Sun, 22 Apr 2012 13:29:39 +0400 Subject: [PATCH] Don't replace already configured xorg.conf.* files --- sbin/snail.configure | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/sbin/snail.configure b/sbin/snail.configure index 61d9d52..020d5dd 100755 --- a/sbin/snail.configure +++ b/sbin/snail.configure @@ -213,17 +213,19 @@ case "$DISTRIB_ID" in esac echo "Creating backups of original xorg.conf.* files and replacing with snail's versions..." -[[ -f /etc/X11/xorg.conf && ! -f /etc/X11/xorg.conf.snail-bkp ]] && mv /etc/X11/xorg.conf /etc/X11/xorg.conf.snail-bkp -[[ -f /etc/X11/xorg.conf.intel && ! -f /etc/X11/xorg.conf.intel.snail-bkp ]] && mv /etc/X11/xorg.conf.intel /etc/X11/xorg.conf.intel.snail-bkp -[[ -f /etc/X11/xorg.conf.nvidia && ! -f /etc/X11/xorg.conf.nvidia.snail-bkp ]] && mv /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf.nvidia.snail-bkp -cp -f /etc/X11/xorg.conf.intel.snail /etc/X11/xorg.conf.intel -cp -f /etc/X11/xorg.conf.nvidia.snail /etc/X11/xorg.conf.nvidia -ln -sf xorg.conf.intel /etc/X11/xorg.conf +if [[ ! -f /etc/X11/xorg.conf.nvidia.snail && ! -f /etc/X11/xorg.conf.intel.snail ]]; then + [[ -f /etc/X11/xorg.conf && ! -f /etc/X11/xorg.conf.snail-bkp ]] && mv /etc/X11/xorg.conf /etc/X11/xorg.conf.snail-bkp + [[ -f /etc/X11/xorg.conf.intel && ! -f /etc/X11/xorg.conf.intel.snail-bkp ]] && mv /etc/X11/xorg.conf.intel /etc/X11/xorg.conf.intel.snail-bkp + [[ -f /etc/X11/xorg.conf.nvidia && ! -f /etc/X11/xorg.conf.nvidia.snail-bkp ]] && mv /etc/X11/xorg.conf.nvidia /etc/X11/xorg.conf.nvidia.snail-bkp + cp -f /etc/X11/xorg.conf.intel.snail /etc/X11/xorg.conf.intel + cp -f /etc/X11/xorg.conf.nvidia.snail /etc/X11/xorg.conf.nvidia + ln -sf xorg.conf.intel /etc/X11/xorg.conf -echo "Recognizing BusID of both chips and set it in xorg.conf.* files..." -BusIDIntel="PCI:`lspci | grep VGA | grep Intel | cut -d" " -f1 | sed 's~\.~\:~g ; s~0\([0-9]\)~\1~g'`" -BusIDNvidia="PCI:`lspci | grep VGA | grep nVidia | cut -d" " -f1 | sed 's~\.~\:~g ; s~0\([0-9]\)~\1~g'`" -sed -i "s~BusIDIntel~$BusIDIntel~" /etc/X11/xorg.conf.intel -sed -i "s~BusIDNvidia~$BusIDNvidia~" /etc/X11/xorg.conf.nvidia + echo "Recognizing BusID of both chips and set it in xorg.conf.* files..." + BusIDIntel="PCI:`lspci | grep VGA | grep Intel | cut -d" " -f1 | sed 's~\.~\:~g ; s~0\([0-9]\)~\1~g'`" + BusIDNvidia="PCI:`lspci | grep VGA | grep nVidia | cut -d" " -f1 | sed 's~\.~\:~g ; s~0\([0-9]\)~\1~g'`" + sed -i "s~BusIDIntel~$BusIDIntel~" /etc/X11/xorg.conf.intel + sed -i "s~BusIDNvidia~$BusIDNvidia~" /etc/X11/xorg.conf.nvidia +fi echo "`basename -- $0` is complete! ;-)"