#!/bin/bash
# Supersize Fedora for Fedora 12 (please adjust for other versions of Fedora)
# this scripts needs root rights, because it installs programs
# made by suvi.org for the Linux Community
echo "Please run this skript as root user!"
echo "Please look at the popup dialog!"
echo " "

# Check if zenity is installed
rpm -q zenity > /dev/null 
if [ $? = 1 ];then
	yum -y install zenity
fi

zenity --question --title "Supersize Fedora12! by suvi.org" --text "Welcome. Do you want to install a lot of cool programs?"
if [ $? = 1 ];then
	zenity --info --title "goodbye" --text "Well then far well"
	echo "Goodbye"
	exit 1
fi
echo "Installing programs"

#//This things we are going to install anyway
#////////////////////////////////
#adding livna repository to yum FEDORA
rpm -Uvh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

#//Gnome device Manager
yum -y install gnome-device-manager
#//Enhancements for Nautlius File Manager
yum -y install nautilus-actions nautilus-image-converter
#/////////////
#//COMMAND LINE TOOLS and other TOOLS
yum -y install unrar
yum -y install htop

############################### Auswahlmenü #################################################

function menu {

# Menü für alle anderen
SELECTION=`zenity --list --checklist --width=800 --height=450 --text "Please select packages for installation?" --title "Suvi.org Supersize Fedora installer" --column="" --column Punkt --column Beschreibung \
\"\" "ATI 3D Driver"	        "The ATI 3D grafic-driver(WARNING:HD Series only!!!) and Compiz 3D" \
\"\" "NVIDIA 3D Driver"	        "The NVIDIA grafic-driver and Compiz 3D" \
\"\" Flash			"Adove Flash-Plugin for webbrowsers (Firefox, Konqueror, Opera)" \
\"\" Thunderbird		"Thunderbird Email and Lightning calender plugin" \
\"\" Movieplayers		"Mplayer, VLC and MP3 Support" \
\"\" Bluefish			"Bluefish, an advanced texteditor" \
\"\" Sykpe			"Skype instantmessanger, for calls and chat" \
\"\" Filezilla			"Filezilla, a FTP Client" \
\"\" Inkscape			"Inkscape, a vector graphiceditor" \
\"\" Gimp			"Gimp, a pixel graphiceditor" \
\"\" Azureus			"Azureus (aka Vuze) for bittorrent movie trailers" \
\"\" Moovida			"Movida (aka Elisa) Media Center" \
\"\" "MYSQL PHP"		"MYSQL Database and PHP for webdevelopers" \
\"\" Wine			"Wine, emulator to run MS windows programs" \
`

# Auswahl des Folgemenüs

if [ -z "$SELECTION" ];then
	echo "Ok, nothing to install"
fi
echo $SELECTION | grep "ATI 3D Driver" > /dev/null
if [ $? = 0 ];then
	install_ati3d
fi
echo $SELECTION | grep "NVIDIA 3D Driver" > /dev/null
if [ $? = 0 ];then
	install_nvidia3d
fi
echo $SELECTION | grep Flash > /dev/null
if [ $? = 0 ];then
	install_flash
fi
echo $SELECTION | grep Thunderbird > /dev/null
if [ $? = 0 ];then
	install_thunderbird
fi
echo $SELECTION | grep Movieplayers > /dev/null
if [ $? = 0 ];then	
	install_movieplayers_mp3
fi
echo $SELECTION | grep Bluefish > /dev/null
if [ $? = 0 ];then
	install_bluefish
fi
echo $SELECTION | grep  Skype > /dev/null
if [ $? = 0 ];then
	install_skype
fi
echo $SELECTION | grep Filezilla > /dev/null
if [ $? = 0 ];then
	install_filezilla
fi
echo $SELECTION | grep Inkscape > /dev/null
if [ $? = 0 ];then
	install_inkscape
fi
echo $SELECTION | grep Gimp > /dev/null
if [ $? = 0 ];then
	install_gimp
fi
echo $SELECTION | grep Azureus > /dev/null
if [ $? = 0 ];then
	install_azureus
fi
echo $SELECTION | grep Moovida > /dev/null
if [ $? = 0 ];then
	install_moovida
fi
echo $SELECTION | grep "MYSQL PHP" > /dev/null
if [ $? = 0 ];then
	install_mysql_php
fi
echo $SELECTION | grep Wine > /dev/null
if [ $? = 0 ];then
	install_wine
fi
}

#////////////////////
#//Compiz the 3D Windows Manager
function install_compiz {
yum -y install gnome-compiz-manager
}

#NVIDIA 3D DRIVER
function install_nvidia3d {
yum -y install kmod-nvidia
install_compiz
# use this command to turn off nvidia driver later
#  /usr/sbin/nvidia-config-display disable
}

#ATI 3d DRIVER
function install_ati3d {
yum -y install kmod-catalyst xorg-x11-drv-catalyst xorg-x11-drv-catalyst-libs
install_compiz
}

#//MAC OS-X dock like bar, to show lamer friends, who don't use bash
#yum -y install avant-window-navigator

#///////////////
#//APPLICATIONS

#//Adobe Flash Plugin, needs a firefox restart under Fedora
function install_flash {
rpm -Uvh http://linuxdownload.adobe.com/adobe-release/adobe-release-i386-1.0-1.noarch.rpm
yum -y install flash-plugin alsa-plugins-pulseaudio libcurl
}

#//Adobe PDF Reader
# download from http://www.adobe.com/products/acrobat/readstep2.html

#//Mozilla Thunderbird Email, Thunderbird-Lightning (or Sunbird Calendar)
function install_thunderbird {
yum -y install thunderbird
yum -y install thunderbird-lightning
#sundbird would be the calendar app as standalone, but we allready have the lighting plugin.
#yum -y install sunbird
}

#//installing movie players and mp3 suppport
function install_movieplayers_mp3 {
yum -y install mplayer gnome-mplayer
yum -y install vlc
#//mplayerplug-in should work on trailers.apple.com
yum -y install gecko-mediaplayer
#//Installing soundplayer audacious , sound editor audacity
yum -y install audacious audacious-plugins-nonfree-mp3
#yum -y install audacious-plugins-nonfree-wma.i386 
yum -y install audacity-nonfree
}

#//Text Editor bluefish
function install_bluefish {
yum -y install bluefish
}

#//Skype online chat (first dependencies) (-fc7 is correct for fedora 10 as well)
function install_skype {
yum -y install nas qt4 qt4-x11 redhat-rpm-config
rpm -Uvh http://www.skype.com/go/getskype-linux-fc7
#Seconds way: skype.repo 
#//[skype]
#// name=Skype Repository
#// baseurl=http://download.skype.com/linux/repos/fedora/updates/i586/
#// gpgkey=http://www.skype.com/products/skype/linux/rpm-public-key.asc
#// gpgcheck=0
#// enabled=1
#//yum -c install skype
}

#//Arial, Times New, Veranda Fonts
#wget http://www.mjmwired.net/resources/files/msttcorefonts-2.0-1.noarch.rpm
#rpm -ivh msttcorefonts-2.0-1.noarch.rpm

#//FTP Client filezilla
function install_filezilla {
yum -y install filezilla
}

#//FOR LAPTOP USERS
#yum -y install powertop

#//Graphic Tools
function install_inkscape {
yum -y install inkscape
}
function install_gimp {
yum -y install gimp
}

#//Azureus - nice bittorrent app with great movie preview
function install_azureus {
yum -y install azureus
}

#//Moovida (aka Elisa) Media Center
function install_moovida {
yum -y install elisa
}

#//////////////////
#//DEVELOPMENT LAMP

#//MySQL and PHP
function install_mysql_php {
yum -y install mysql-server mysql-gui-tools
yum -y install php php-mysql php-gd php-xml
yum -y install phpMyAdmin
#// start or restart apache after this
/etc/init.d/httpd restart
#// for zendframework please go to http://framework.zend.com/download (no official yum repo yet)
}

#wine emulates windows win32 library
function install_wine {
yum -y install wine cabextract
}

#///////////////
#//Games
#function install_games {
#yum -y install xrick maniadrive supertux supertuxkart
#}

#//For formating and partionating disks, better use mkfs.ext3 or parted !
#yum -y install gparted

#////////////////
#GNOME settings

#//change Panels to light blue colors and use transparence
#//someone know how to script this?

#////////////////////////////////////
#InstallerMenu - Writing comments for user
menu

echo "All programms installed."
echo "Thank you for using suvi.org Fedora Supersize skript!"
zenity --info --title "All programms installed" --text "Thank you for using the suvi.org Fedora Supersize skript!"
echo "Goodbye"


