All pastes #938909 Raw Edit

Untitled

public text v1 · immutable
·published 2008-03-11 22:49 UTC
rendered paste body
diff --git a/compiz-manager b/compiz-manager
index 81bcdd3..c0a4524 100755
--- a/compiz-manager
+++ b/compiz-manager
@@ -53,6 +53,9 @@ FALLBACKWM_OPTIONS="--replace $@"
 # Driver whitelist
 WHITELIST="nvidia intel ati radeon i810"
 
+# Allow lspci command line to be overridden if not in the PATH
+LSPCI="lspci"
+
 # blacklist based on the pci ids 
 # See http://wiki.compiz-fusion.org/Hardware/Blacklist for details
 T="   1002:5954 1002:5854 1002:5955" # ati rs480
@@ -65,9 +68,6 @@ COMPIZ_OPTIONS="--ignore-desktop-hints --replace"
 COMPIZ_PLUGINS=""
 ENV=""
 
-# Use emerald by default if it exist
-USE_EMERALD="yes"
-
 # No indirect by default
 INDIRECT="no"
 
@@ -75,7 +75,7 @@ INDIRECT="no"
 XORG_DEFAULT_LOG="/var/log/Xorg.0.log"
 
 # Set to yes to enable verbose
-VERBOSE="yes"
+#VERBOSE="no"
 
 # Echos the arguments if verbose
 verbose()
@@ -89,12 +89,12 @@ verbose()
 abort_with_fallback_wm()
 {
 	if [ "x$SKIP_CHECKS" = "xyes" ]; then
-		verbose "SKIP_CHECKS is yes, so continuing despite problems.\n"
+		echo "SKIP_CHECKS is yes, so continuing despite problems."
 		return 0;
 	fi
 	
 	if [ "x$CM_DRY" = "xyes" ]; then
-		verbose "Dry run failed: Problems detected with 3D support.'n"
+		echo "Dry run failed: Problems detected with 3D support."
 		exit 1;
 	fi
 
@@ -103,7 +103,7 @@ abort_with_fallback_wm()
 	if [ -x $FALLBACKWM ]; then
 		exec $FALLBACKWM $FALLBACKWM_OPTIONS
 	else
-		printf "no $FALLBACKWM found, exiting\n"
+		echo "Error: fallback window manager \"$FALLBACKWM\" not found, exiting"
 		exit 1
 	fi
 }
@@ -117,6 +117,7 @@ check_npot_texture()
 		return 0;
 	else
 		verbose "Not present. \n"
+		echo "Error: non-power-of-two texture support is missing"
 		return 1;
 	fi
 
@@ -141,6 +142,7 @@ check_fbconfig()
 	else
 		unset FB
 		verbose "not present. \n"
+		echo "Error: FBConfig is missing"
 		return 1;
 	fi
 }
@@ -158,6 +160,7 @@ check_tfp()
 		if [ "$INDIRECT" = "yes" ]; then
 			unset LIBGL_ALWAYS_INDIRECT
 			INDIRECT="no"
+			echo "Error: GLX_EXT_texture_from_pixmap is missing"
 			return 1;
 		else
 			verbose "Trying again with indirect rendering:\n";
@@ -178,6 +181,7 @@ check_composite()
 		return 0;
 	else
 		verbose "not present. \n";
+		echo "Error: Composite extension is missing"
 		return 1;
 	fi
 }
@@ -200,7 +204,7 @@ check_nvidia_memory()
 {
 	MEM=$(${NVIDIA_SETTINGS} -q VideoRam | egrep Attribute\ \'VideoRam\'\ .*: | cut -d: -f3 | sed 's/[^0-9]//g')
 	if [ $MEM -lt $NVIDIA_MEMORY ]; then
-		verbose "Less than ${NVIDIA_MEMORY}kb of memory and nVidia";
+		echo "Error: Less than ${NVIDIA_MEMORY}kb of memory and nVidia";
 		return 1;
 	fi
 	return 0;
@@ -234,6 +238,7 @@ check_texture_size()
 	verbose "Comparing resolution ($RESOLUTION) to maximum 3D texture size ($TEXTURE_LIMIT): ";
 	if [ $VRES -gt $TEXTURE_LIMIT ] || [ $HRES -gt $TEXTURE_LIMIT ]; then
 		verbose "Failed.\n"
+		echo "Error: resolution is greater thanmaximum texture size"
 		return 1;
 	fi
 	verbose "Passed.\n"
@@ -260,21 +265,21 @@ running_under_whitelisted_driver()
 			return 0
 		fi
 	done
-	verbose "No whitelisted driver found\n"
+	echo "Error: No whitelisted driver found"
 	return 1
 }
 
 # check pciid blacklist
 have_blacklisted_pciid()
 {
-	OUTPUT=$(lspci -n)
+	OUTPUT=$(${LSPCI} -n)
 	for ID in ${BLACKLIST_PCIIDS}; do
 		if echo "$OUTPUT" | egrep -q "$ID"; then
-			verbose "Blacklisted PCIID '$ID' found \n"
+			echo "Error: Blacklisted PCIID '$ID' found"
 			return 0
 		fi
 	done
-	OUTPUT=$(lspci -vn | grep -i VGA)
+	OUTPUT=$(${LSPCI} -vn | grep -i VGA)
 	verbose "Detected PCI ID for VGA: $OUTPUT\n"
 	return 1
 }
@@ -335,6 +340,7 @@ fi
 
 # Don't use compiz when running the failsafe session
 if [ "x$GNOME_DESKTOP_SESSION_ID" = "xFailsafe" ]; then
+	echo "Error: running in failsafe session"
 	abort_with_fallback_wm
 fi
 
@@ -375,19 +381,12 @@ build_env
 build_args
 
 if [ "x$CM_DRY" = "xyes" ]; then
-	verbose "Dry run finished: everything should work with regards to Compiz and 3D.\n"
+	echo "Dry run finished: everything should work with regards to Compiz and 3D."
 	exit 0;
 fi
-# start the gtk-window-decorator if present
-if [ -x ${COMPIZ_BIN_PATH}emerald ] && [ "$USE_EMERALD" = "yes" ]; then
-	verbose "Starting emerald\n"
-	${COMPIZ_BIN_PATH}emerald --replace &
-elif [ -x ${COMPIZ_BIN_PATH}gtk-window-decorator ] && [ -n "$GNOME_DESKTOP_SESSION_ID" ]; then
-	verbose "Starting gtk-window-decorator\n"
-	${COMPIZ_BIN_PATH}gtk-window-decorator --replace &
-elif [ -x ${COMPIZ_BIN_PATH}kde-window-decorator ] && [ -n "$KDE_FULL_SESSION" ]; then
-	verbose "Starting kde-window-decorator\n"
-	${COMPIZ_BIN_PATH}kde-window-decorator --replace &
+
+# set fallback to kwin for KDE users
+if [ -n "$KDE_FULL_SESSION" ]; then
 	FALLBACKWM="${KWIN}"
 fi