#!/bin/bash
# togglemetacomp by Katja (fly5.kapsi.fi)
# toggle metacity composition on and off

if [[ "$1" == "status" || "$1" == "s" ]]; then
	if [[ "`gconftool-2 --get /apps/metacity/general/compositing_manager`" == "true" ]]; then
		COMPSTATUS="ON"
	else
		COMPSTATUS="OFF"
	fi

	echo "Composition is turned $COMPSTATUS"
	exit $?
fi

if [[ "`gconftool-2 --get /apps/metacity/general/compositing_manager`" == "true" ]]; then
	gconftool-2 --set /apps/metacity/general/compositing_manager \
	 --type boolean false
	COMPSTAT="OFF"
else
	gconftool-2 --set /apps/metacity/general/compositing_manager \
	 --type boolean true
	COMPSTAT="ON"
fi

echo "Composition turned $COMPSTAT"

# EOF

