#!/bin/bash
# This program comes with no warranties specific or implied. I tested the heck out of
#+ it on my own system but I make no promises it wont turn yours into the fluffy tail of 
#+ an atomic/radioactive hamster(R)(TM) 
#
# Tried to make it as clean and straight forward as posible, hence all the comments.
# If there's something about this script you don't like you can fix it yourself and bugger
#+ off ;) . That's all folks,
# 										Cheer!

menu ()
{
	clear # Clears the screen
	
	# Draw the menu
	echo # blank

	echo "(1) Enable SCIM (if you really want to be annoyed)"
	echo
	echo "(2) Disable extra repos (return to original)"
	echo 
	echo "(3) Return to the factory interface settings"
	echo
	echo "(q) Quit"
	echo
	echo
	echo
	echo "My choice is: "	
	read choice # Get the user's choice

	case "$choice" in

		"1" ) # Enable SCIM to reinstall the Xandros-SCIM package"
			echo "Installing xandros-scim package..."
			sudo apt-get install xandros-scim
			echo "SCIM installed (Restart recomended)"
			echo

			echo "Press Enter to return to menu"	
			read
			menu # Reset the menu					
		;;

		"2" ) # Disable extra repos (return to original Asus sources.list)			
			cd /tmp
# Recreate the original sources.list file (all the settings that are in by default)
			echo "Creating custom sources.list..."
			echo "deb http://update.eeepc.asus.com/p701/ p701 main" >> .sources
			echo "deb http://update.eeepc.asus.com/p701/en/ p701 main" >> .sources

			echo "Overwriting original..."
			sudo mv .sources /etc/apt/sources.list
			
# Don't know if I should delete the pinning file (preferences) i tend to keep it just in case I later decide to install more 
#+ repositories. If you don't want it on you system just uncoment the next line  
			# sudo rm /etc/apt/preferences
			echo "Retrieving new package lists"
			sudo apt-get update

			echo "Press Enter to return to menu"	
			read
			menu # Reset the menu					
		;;


		"3" ) # Delete custom theme
			echo "Removing custom theme options..."
			rm -r ~/.icewm
			
			echo "Restart required"

			echo "Press Enter to return to menu"	
			read
			menu # Reset the menu					
		;;

		"Q" | "q" ) # Quit this wonderous world of EeeNirvana
			clear
			echo Bye!
			exit 0
		;;

		* ) # Wrong input
			echo "Invalid input"
			echo
			echo "Press Enter to return to menu"	
			read
			menu # Reset the menu
		;;
	esac
}

menu

# This program will achieve 
#+ GLOBAL DOMINATION!!!
#+ MUHAHAHAHA!!!

