#!/bin/bash
# NOTE! This script is a crude hack that has a better solution!
# to force a default bpp in X, it's better to edit /etc/X11/XF86Config and
# add DefaultColorDepth 24 (or whatever) to the SCREEN section.
#
# Section "Screen"
#    Driver          "Accel"
#    Device          "Primary Card"
#    Monitor         "Primary Monitor"
#    DefaultColorDepth 16
#    SubSection "Display"
#
# -Erik Greenwald



DEFAULTBPP=16

killall gpm

case "$1" in
	8)
		cd /
		startx -- -bpp 8 &
		;;
	16)
		cd /
		startx -- -bpp 16 &
		;;
	24)
		cd /
		startx -- -bpp 24 &
		;;
	32)
		cd /
		startx -- -bpp 32 &
		;;
	help)
		echo
		echo "Starts the windows on the specified bpp"
		echo "Usage:"
		echo "	win {8|16|24|32|help|*}"
		echo "	Current default: $DEFAULTBPP"
		;;
	*)
		cd /
		startx -- -bpp $DEFAULTBPP &
		;;
esac
