#dont vt switch as desired
ALLOW_SWITCH=$(groovix-get-parameter GX_ALLOW_VT_SWITCH)

if [ "$ALLOW_SWITCH" = "true" ] ; then
	echo "allowing vt switching"
	DONT_SWITCH="false"
else
	echo "NOT allowing vt switching"
	DONT_SWITCH="true"
fi

grep DontVTSwitch /etc/X11/xorg.conf ; 
if [ $? -eq 0 ] ; then
	echo "changing DontVTSwitch option to $DONT_SWITCH"
	sed -i "s/Option.*DontVTSwitch.*/Option \"DontVTSwitch\" \"$DONT_SWITCH\"/" /etc/X11/xorg.conf
else
	echo "DontVTSwitch option doesn't exist yet"
	if [ "$ALLOW_SWITCH" = "false" ] ; then

		echo "
Section \"ServerFlags\"
        Option \"DontVTSwitch\" \"$DONT_SWITCH\"
EndSection
" >> /etc/X11/xorg.conf

	else
		echo "DontVTSwitch option left out to allow vt switching"
	fi

fi
