sh 最终的Arch Linux安装脚本

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sh 最终的Arch Linux安装脚本相关的知识,希望对你有一定的参考价值。

#!/bin/bash
#-------------------------------------------------------------------------------
#Created by helmuthdu mailto: helmuthdu[at]gmail[dot]com
#Inspired by Andreas Freitag, aka nexxx script
#-------------------------------------------------------------------------------
#This program is free software: you can redistribute it and/or modify
#it under the terms of the GNU General Public License as published by
#the Free Software Foundation, either version 3 of the License, or
#(at your option) any later version.
#
#This program is distributed in the hope that it will be useful,
#but WITHOUT ANY WARRANTY; without even the implied warranty of
#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#GNU General Public License for more details.
#
#You should have received a copy of the GNU General Public License
#along with this program.  If not, see <http://www.gnu.org/licenses/>.
#-------------------------------------------------------------------------------
# Run this script after your first boot with archlinux (as root)
# source: https://bbs.archlinux.org/viewtopic.php?pid=1021036

GNOME=0
ARCHI=`uname -m`

# Automatically detects the system language based on your rc.conf
LOCATION=`cat /etc/rc.conf | sed -n '/LOCALE=/p' | sed '1!d' | cut -c9-13`
LOCATION_KDE=`echo $LOCATION | tr '[:upper:]' '[:lower:]'`
LOCATION_GNOME=`echo $LOCATION | tr '[:upper:]' '[:lower:]' | sed 's/_/-/'`
LOCATION_LO=`echo $LOCATION | sed 's/_/-/'`

function question_for_answer(){ #{{{
	read -p "$1 [y][n]: " OPTION
	echo ""
} #}}}
function install_status(){ #{{{
	if [ $? -ne 0 ] ; then
		CURRENT_STATUS=-1
	else
		CURRENT_STATUS=1
	fi
} #}}}
function print_line(){ #{{{
	echo "--------------------------------------------------------------------------------"
} #}}}
function print_title (){ #{{{
	clear
	echo "#-------------------------------------------------------------------------------"
	echo -e "# $1"
	echo "#-------------------------------------------------------------------------------"
	echo ""
} #}}}
function add_new_daemon(){ #{{{
	remove_daemon "$1"
	sed -i '/DAEMONS[=]/s/\(.*\)\>/& '"$1"'/' /etc/rc.conf
} #}}}
function remove_daemon(){ #{{{
	sed -i '/DAEMONS[=]/s/'"$1"' //' /etc/rc.conf
} #}}}
function add_new_module(){ #{{{
	remove_module "$1"
	sed -i '/MODULES[=]/s/\(.*\)\>/& '"$1"'/' /etc/rc.conf
	#sed -i '/MODULES[=]/s/^[^ ]*\>/& '"$1"'/' /etc/rc.conf
} #}}}
function remove_module(){ #{{{
	sed -i '/MODULES[=]/s/'"$1"' //' /etc/rc.conf
} #}}}
function finish_function(){ #{{{
	print_line
	echo "Continue with RETURN"
	read
	clear
} #}}}
function sumary(){ #{{{
	case $CURRENT_STATUS in
		0)
			print_line
			echo "$1 not successfull (Canceled)"
			;;
		-1)
			print_line
			echo "$1 not successfull (Error)"
			;;
		1)
			print_line
			echo "$1 successfull"
			;;
		*)
			print_line
			echo "WRONG ARG GIVEN"
			;;
	esac
} #}}}
#begin #{{{
	clear
	echo "Welcome to the Ultimate Archlinux install script by helmuthdu"
	echo "Inspired by freitag archlinux helper script install"
	print_line
	echo "Requirements:"
	echo "-> Archlinux installation"
	echo "-> Run script as root user"
	echo "-> Working internet connection"
	print_line
	echo "Script can be canceled all the time with CTRL+C"
	print_line
	echo "OPEN THIS SCRIPTS AND READ ALL OPTIONS BEFORE USE IT"
	echo "Not recommended use this script more then 1 time (create duplicate values)"
	echo "This version is still in BETA. Send bugreports to: "
	echo "helmuthdu at gmail dot com"
	finish_function
#}}}
#custom repositories #{{{
	print_title "CUSTOM REPOSITORIES"
	question_for_answer "Install custom repositories (ayatana)"
	case "$OPTION" in
		"y")
			echo -e '[ayatana]\nServer = http://repo.ayatana.info/' >> /etc/pacman.conf
			echo -e '\n[custom]\nServer = file:///media/backup/Archlinux/$arch' >> /etc/pacman.conf
			install_status
			;;
		*)
			CURRENT_STATUS=0
			;;
	esac
	sumary "Custom repositories installation"
	finish_function
#}}}
#rankmirror #{{{
	print_title "RANKMIRROR - https://wiki.archlinux.org/index.php/Improve_Pacman_Performance"
	question_for_answer "Choosing the fastest mirror using rankmirror (this can take a while)"
	case "$OPTION" in
		"y")
			cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
			sed -i '/^#\S/ s|#||' /etc/pacman.d/mirrorlist.backup
			rankmirrors -n 5 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist
			install_status
			;;
		*)
			CURRENT_STATUS=0
			;;
	esac
	sumary "New mirrorlist creation"
	finish_function
#}}}
#system update #{{{
	print_title "UPDATING YOUR SYSTEM"
	pacman -Syu
	read -p "Reboot your system [y][n]: " OPTION
	if [ $OPTION = "y" ]; then
		reboot
		exit 0
	fi
#}}}
#create a new user #{{{
	print_title "CREATE USER ACCOUNT"
	read -p "New user name: " USERNAME
	useradd -m -g users -G users,audio,lp,optical,storage,video,wheel,games,power,scanner -s /bin/bash $USERNAME
	passwd $USERNAME
	#set user as sudo #{{{
		pacman -S --noconfirm sudo
		## Uncomment to allow members of group wheel to execute any command
		sed -i '/%wheel ALL=(ALL) ALL/s/^#//' /etc/sudoers
		## Same thing without a password (not secure)
		#sed -i '/%wheel ALL=(ALL) NOPASSWD: ALL/s/^#//' /etc/sudoers
	#}}}
#}}}
#yaourt #{{{
	print_title "YAOURT - https://wiki.archlinux.org/index.php/Yaourt"
	question_for_answer "Install yaourt - AUR Backend (required for many Packages)?"
	case "$OPTION" in
		"y")
			pacman -S --noconfirm base-devel yajl
			su -l $USERNAME --command="
				wget http://aur.archlinux.org/packages/package-query/package-query.tar.gz;
				tar zxvf package-query.tar.gz;
				cd package-query;
				makepkg --noconfirm -si;
				cd ..;
				rm -fr package-query*
			"
			su -l $USERNAME --command="
				wget http://aur.archlinux.org/packages/yaourt/yaourt.tar.gz;
				tar zxvf yaourt.tar.gz;
				cd yaourt;
				makepkg --noconfirm -si;
				cd ..;
				rm -fr yaourt*
			"
			install_status
			;;
		*)
			CURRENT_STATUS=0
			;;
	esac
	sumary "Yaourt installation"
	finish_function
#}}}
#base system #{{{
	print_title "BASH TOOLS - https://wiki.archlinux.org/index.php/Bash"
	pacman -S --noconfirm curl bc rsync mlocate bash-completion vim
	print_title "(UN)COMPRESS TOOLS - https://wiki.archlinux.org/index.php/P7zip"
	pacman -S --noconfirm tar gzip bzip2 unzip unrar p7zip
	print_title "DBUS - https://wiki.archlinux.org/index.php/D-Bus"
	pacman -S --noconfirm dbus
	add_new_daemon "dbus"
	print_title "ACPI - https://wiki.archlinux.org/index.php/ACPI_modules"
	pacman -S --noconfirm acpi acpid
	add_new_daemon "acpid"
	#TLP #{{{
	print_title "TLP - https://wiki.archlinux.org/index.php/TLP"
	question_for_answer "Install TLP (great battery improvement on laptops)"
	case "$OPTION" in
		"y")
			su -l $USERNAME --command="yaourt -S --noconfirm tlp"
			add_new_daemon "@tlp"
			install_status
			;;
		*)
			CURRENT_STATUS=0
			;;
	esac
	sumary "TLP installation"
	finish_function
	#}}}
	print_title "CUPS - https://wiki.archlinux.org/index.php/Cups"
	pacman -S --noconfirm cups ghostscript gsfonts
	pacman -S --noconfirm gutenprint foomatic-db foomatic-db-engine foomatic-db-nonfree foomatic-filters hplip splix cups-pdf
	add_new_daemon "@cupsd"
	print_title "NTFS/FAT - https://wiki.archlinux.org/index.php/Ntfs"
	pacman -S --noconfirm ntfs-3g ntfsprogs dosfstools
	print_title "SSH - https://wiki.archlinux.org/index.php/Ssh"
	pacman -S --noconfirm rssh openssh
	add_new_daemon "@sshd"
	#configure ssh/samba #{{{
		echo -e "sshd: ALL\n# End of file" > /etc/hosts.allow
		echo -e "ALL: ALL: DENY\n# End of file" > /etc/hosts.deny
		#ssh_conf #{{{
			sed -i '/ListenAddress/s/^#//' /etc/ssh/sshd_config
			sed -i '/SyslogFacility/s/^#//' /etc/ssh/sshd_config
			sed -i '/LogLevel/s/^#//' /etc/ssh/sshd_config
			sed -i '/LoginGraceTime/s/^#//' /etc/ssh/sshd_config
			sed -i '/PermitRootLogin/s/^#//' /etc/ssh/sshd_config
			sed -i '/StrictModes/s/^#//' /etc/ssh/sshd_config
			sed -i '/RSAAuthentication/s/^#//' /etc/ssh/sshd_config
			sed -i '/PubkeyAuthentication/s/^#//' /etc/ssh/sshd_config
			sed -i '/IgnoreRhosts/s/^#//' /etc/ssh/sshd_config
			sed -i '/PermitEmptyPasswords/s/^#//' /etc/ssh/sshd_config
			sed -i '/X11Forwarding/s/^#//' /etc/ssh/sshd_config
			sed -i '/X11Forwarding/s/no/yes/' /etc/ssh/sshd_config
			sed -i '/X11DisplayOffset/s/^#//' /etc/ssh/sshd_config
			sed -i '/X11UseLocalhost/s/^#//' /etc/ssh/sshd_config
			sed -i '/PrintMotd/s/^#//' /etc/ssh/sshd_config
			sed -i '/PrintMotd/s/yes/no/' /etc/ssh/sshd_config
			sed -i '/PrintLastLog/s/^#//' /etc/ssh/sshd_config
			sed -i '/TCPKeepAlive/s/^#//' /etc/ssh/sshd_config
			sed -i '/the setting of/s/^/#/' /etc/ssh/sshd_config
			sed -i '/RhostsRSAAuthentication and HostbasedAuthentication/s/^/#/' /etc/ssh/sshd_config
			sed -i 's/ListenAddress ::/s/^/#/' /etc/ssh/sshd_config
		#}}}
	#}}}
	print_title "SAMBA - https://wiki.archlinux.org/index.php/Samba"
	pacman -S --noconfirm samba
	cp /etc/samba/smb.conf.default /etc/samba/smb.conf
	add_new_daemon "@samba"
	print_title "ALSA - https://wiki.archlinux.org/index.php/Alsa"
	pacman -S --noconfirm alsa-utils alsa-plugins
	sed -i '/MODULES[=]/s/snd-usb-audio//' /etc/rc.conf
	sed -i '/MODULES[=]/s/MODULES[=](/&snd-usb-audio/' /etc/rc.conf
	add_new_daemon "@alsa"
#}}}
#X #{{{
	print_title "XORG - https://wiki.archlinux.org/index.php/Xorg"
	echo "Installing X-Server (req. for Desktopenvironment, GPU Drivers, Keyboardlayout,...)"
	pacman -S --noconfirm xorg-server xorg-xinit xorg-utils xorg-server-utils xorg-xkill xorg-xauth
	pacman -S --noconfirm xf86-input-evdev xf86-input-synaptics
	pacman -S --noconfirm mesa mesa-demos
	pacman -S --noconfirm xorg-twm xorg-xclock xterm
	pacman -S --noconfirm udisks gamin
#}}}
#graphic cards #{{{
	print_title "GRAPHIC CARD"
	echo "Select your GPU:"
	echo "[1] Intel"
	echo "[2] ATI"
	echo "[3] nVidia"
	echo "[4] Nouveau"
	echo "[5] Virtualbox"
	echo ""
	echo "[q] QUIT"
	echo ""
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
			pacman -S --noconfirm libgl xf86-video-intel
			install_status
			sumary "Intel GPU driver installation"
			;;
		2)
			echo "
			[catalyst]
			Server = http://catalyst.apocalypsus.net/repo/catalyst/\$arch" >> /etc/pacman.conf
			pacman -Sy
			pacman -S  --noconfirm catalyst catalyst-utils
			install_status
			sumary "ATI GPU driver installation"
			;;
		3)
			pacman -Rdd --noconfirm libgl
			pacman -S --noconfirm nvidia nvidia-utils
			install_status
			sumary "nVidia GPU driver installation"
			;;
		4)
			pacman -S --noconfirm libgl xf86-video-nouveau nouveau-dri
			modprobe nouveau
			add_new_module "nouveau"
			install_status
			sumary "Nouveau GPU driver installation"
			;;
		5)
			pacman -S --noconfirm virtualbox-archlinux-additions
			modprobe -a vboxguest vboxsf vboxvideo
			add_new_module "vboxguest vboxsf vboxvideo"
			groupadd vboxsf
			gpasswd -a $USERNAME vboxsf
			install_status
			sumary "Virtualbox guest additions (incl. video drivers) installation"
			;;
		*)
			CURRENT_STATUS=0
			sumary "GPU drivers installation"
			;;
	esac
	finish_function
#}}}
#git access thru a firewall #{{{
	print_title "GIT-TOR - https://wiki.archlinux.org/index.php/Tor"
	question_for_answer "Ensuring access to GIT through a firewall (bypass college firewall)"
	case "$OPTION" in
		"y")
			su -l $USERNAME --command="yaourt -S --noconfirm gtk-doc openbsd-netcat vidalia privoxy git"
			if [ ! -f /usr/bin/proxy-wrapper ]; then
				echo 'forward-socks5   /               127.0.0.1:9050 .' >> /etc/privoxy/config
				echo -e '#!/bin/bash\nnc.openbsd -xlocalhost:9050 -X5 $*' > /usr/bin/proxy-wrapper
				chmod +x /usr/bin/proxy-wrapper
				echo -e '\nexport GIT_PROXY_COMMAND="/usr/bin/proxy-wrapper"' >> /etc/bash.bashrc
				export GIT_PROXY_COMMAND="/usr/bin/proxy-wrapper"
				su -l $USERNAME --command="export GIT_PROXY_COMMAND=\"/usr/bin/proxy-wrapper\""
			fi
			#groupadd -g 42 privoxy
			#useradd -u 42 -g privoxy -s /bin/false -d /etc/privoxy privoxy
			pacman -S --noconfirm tor privoxy
			rc.d start tor privoxy
			su -l $USERNAME --command="sudo /etc/rc.d/tor restart"
			su -l $USERNAME --command="sudo /etc/rc.d/privoxy restart"
			add_new_daemon "@tor @privoxy"
			install_status
			;;
		*)
			CURRENT_STATUS=0
			;;
	esac
	sumary "GIT-TOR installation"
	finish_function
#}}}
#desktop environment #{{{
	print_title "DESKTOP ENVIRONMENT - https://wiki.archlinux.org/index.php/Desktop_Environment"
	echo "Choose your desktop-environment:"
	echo "[1] GNOME"
	echo "[2] KDE"
	echo "[3] XFCE"
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
			#GNOME #{{{
			print_title "GNOME - https://wiki.archlinux.org/index.php/GNOME"
			pacman -S --noconfirm gnome gnome-extra
			pacman -S --noconfirm gedit-plugins pulseaudio-gnome gnome-tweak-tool telepathy deja-dup
			pacman -S --noconfirm system-config-printer-gnome
			su -l $USERNAME --command="yaourt -S --noconfirm automounter"
			su -l $USERNAME --command="yaourt -S --noconfirm nautilus-open-terminal gnome-defaults-list"
			pacman -Rdd --noconfirm sushi
			su -l $USERNAME --command="yaourt -S --noconfirm gloobus-sushi-bzr"
			pacman -S --noconfirm gksu gvfs-smb xdg-user-dirs
			LOOP=1
			while [ "$LOOP" -ne 0 ]
			do
				print_title "FAVORITE GNOME APPS"
				echo "[1] GnomeShell Themes [eOS, Nord, Faience, Dark Shine]"
				echo "[2] GNOME Icons [Faience, Faenza, Elementary]"
				echo "[3] Themes [Zukitwo, Zukini, eGTK, Light, Aldabra]"
				echo "[4] GnomeShell Extensions"
				echo "[5] GNOME Activity Journal"
				echo "[6] Conky + CONKY-colors"
				echo "[7] Hotot"
				echo "[8] Openshot"
				echo "[9] PDFMod"
				echo "[10] Shotwell"
				echo "[11] Guake"
				echo "[12] X-Chat"
				echo "[13] Packagekit"
				echo ""
				echo "[a] ALL"
				echo "[q] QUIT"
				echo ""
				read -p "Option: " OPTION
				case "$OPTION" in
					1)
						su -l $USERNAME --command="yaourt -S --noconfirm gnome-shell-theme-faience gnome-shell-theme-nord gnome-shell-theme-eos gnome-shell-theme-dark-shine"
						;;
					2)
						su -l $USERNAME --command="yaourt -S --noconfirm faience-icon-theme faenza-cupertino-icon-theme elementary-icons"
						;;
					3)
						su -l $USERNAME --command="yaourt -S --noconfirm zukitwo-themes zukini-theme light-themes-bzr egtk-bzr gtk-theme-aldabra"
						;;
					4)
						su -l $USERNAME --command="yaourt -S --noconfirm gpaste gnome-shell-system-monitor-applet-git gnome-shell-extension-noa11y-git gnome-shell-extension-weather-git gnome-shell-extension-user-theme gnome-shell-extension-workspace-indicator gnome-shell-extension-places-menu gnome-shell-extension-dock gnome-shell-extension-pomodoro gnome-shell-extension-mediaplayer-git"
						;;
					5)
						su -l $USERNAME --command="yaourt -S --noconfirm gnome-activity-journal libzeitgeist zeitgeist-datahub zeitgeist-extensions"
						;;
					6)
						su -l $USERNAME --command="yaourt -S --noconfirm toilet figlet cowsay conky conky-colors"
						sed -i '/MODULES[=]/s/\(.*\)\>/& coretemp it87 acpi-cpufreq/' /etc/rc.conf
						;;
					7)
						su -l $USERNAME --command="yaourt -Sf --noconfirm hotot faenza-hotot-icon"
						;;
					8)
						pacman -S --noconfirm openshot
						;;
					9)
						su -l $USERNAME --command="yaourt -S --noconfirm pdfmod"
						;;
					10)
						pacman -S --noconfirm shotwell
						;;
					11)
						pacman -S --noconfirm guake
						;;
					12)
						pacman -S --noconfirm xchat
						;;
					13)
						pacman -S --noconfirm gnome-packagekit gnome-settings-daemon-updates
						;;
					"a")
						su -l $USERNAME --command="yaourt -S --noconfirm gnome-shell-theme-faience gnome-shell-theme-nord gnome-shell-theme-eos"
						su -l $USERNAME --command="yaourt -S --noconfirm faience-icon-theme faenza-cupertino-icon-theme elementary-icons"
						su -l $USERNAME --command="yaourt -S --noconfirm zukitwo-themes zukini-theme light-themes-bzr egtk-bzr gtk-theme-aldabra"
						su -l $USERNAME --command="yaourt -S --noconfirm gpaste gnome-shell-system-monitor-applet-git gnome-shell-extension-noa11y-git gnome-shell-extension-weather-git gnome-shell-extension-user-theme gnome-shell-extension-workspace-indicator gnome-shell-extension-places-menu gnome-shell-extension-dock gnome-shell-extension-pomodoro gnome-shell-extension-mediaplayer-git"
						su -l $USERNAME --command="yaourt -S --noconfirm gnome-activity-journal libzeitgeist zeitgeist-datahub zeitgeist-extensions"
						su -l $USERNAME --command="yaourt -S --noconfirm pdfmod"
						su -l $USERNAME --command="yaourt -S --noconfirm toilet figlet cowsay conky conky-colors"
						su -l $USERNAME --command="yaourt -Sf --noconfirm hotot faenza-hotot-icon"
						sed -i '/MODULES[=]/s/\(.*\)\>/& coretemp it87 acpi-cpufreq/' /etc/rc.conf
						pacman -S --noconfirm openshot
						pacman -S --noconfirm shotwell
						pacman -S --noconfirm guake
						pacman -S --noconfirm xchat
						pacman -S --noconfirm gnome-packagekit gnome-settings-daemon-updates
						LOOP=0
						;;
					*)
						LOOP=0
						;;
				esac
				finish_function
			done
			GNOME=1
			add_new_daemon "gdm"
			sumary "GNOME installation"
			finish_function
			#}}}
			;;
		2)
			#KDE #{{{
			print_title "KDE - https://wiki.archlinux.org/index.php/KDE"
			pacman -S --noconfirm kde kde-l10n-$LOCATION_KDE
			pacman -Rcsn --noconfirm kdemultimedia-kscd kdemultimedia-juk kdemultimedia-dragonplayer
			pacman -S --noconfirm kdeadmin-system-config-printer-kde xdg-user-dirs
			su -l $USERNAME --command="yaourt -S --noconfirm chakra-gtk-config"
			su -l $USERNAME --command="yaourt -S --noconfirm oxygen-gtk qtcurve-gtk2 qtcurve-kde4 bespin-svn"
			su -l $USERNAME --command="yaourt -S --noconfirm kcm-wacomtablet"
			su -l $USERNAME --command="yaourt -S --noconfirm quickaccess-plasmoid plasma-icontasks"
			LOOP=1
			while [ "$LOOP" -ne 0 ]
			do
				print_title "FAVORITE KDE APPS"
				echo "[1] Plasma Themes [Caledonia]"
				echo "[2] KDE Icons [KFaenza]"
				#these 2 themes are also my :)
				echo "[3] QtCurve Themes [Kawai, Sweet]"
				echo "[4] Choqok"
				echo "[5] K3b"
				echo "[6] Apper"
				echo "[7] Minitube"
				echo "[8] Musique"
				echo "[9] Bangarang"
				echo "[10] Digikam"
				echo "[11] Yakuake"
				echo ""
				echo "[a] ALL"
				echo "[q] QUIT"
				echo ""
				read -p "Option: " OPTION
				case "$OPTION" in
					1)
						su -l $USERNAME --command="yaourt -S --noconfirm plasma-theme-caledonia kdm-theme-caledonia ksplash-caledonia"
						;;
					2)
						su -l $USERNAME --command="yaourt -S --noconfirm kfaenza-icon-theme"
						;;
					3)
						#QtCurve Themes #{{{
						wget http://kde-look.org/CONTENT/content-files/144205-Sweet.tar.gz
						wget http://kde-look.org/CONTENT/content-files/141920-Kawai.tar.gz
						tar zxvf 144205-Sweet.tar.gz
						tar zxvf 141920-Kawai.tar.gz
						rm 144205-Sweet.tar.gz
						rm 141920-Kawai.tar.gz
						mkdir -p /home/$USERNAME/.kde4/share/apps/color-schemes
						mv Sweet/Sweet.colors /home/$USERNAME/.kde4/share/apps/color-schemes
						mv Kawai/Kawai.colors /home/$USERNAME/.kde4/share/apps/color-schemes
						mkdir -p /home/$USERNAME/.kde4/share/apps/QtCurve
						mv Sweet/Sweet.qtcurve /home/$USERNAME/.kde4/share/apps/QtCurve
						mv Kawai/Kawai.qtcurve /home/$USERNAME/.kde4/share/apps/QtCurve
						chown -R $USERNAME:users /home/$USERNAME/.kde4
						rm -fr Kawai Sweet
						#}}}
						;;
					4)
						pacman -S --noconfirm choqok
						;;
					5)
						pacman -S --noconfirm k3b dvd+rw-tools
						;;
					6)
						su -l $USERNAME --command="yaourt -S --noconfirm apper"
						;;
					7)
						su -l $USERNAME --command="yaourt -S --noconfirm minitube"
						;;
					8)
						su -l $USERNAME --command="yaourt -S --noconfirm musique"
						;;
					9)
						su -l $USERNAME --command="yaourt -S --noconfirm bangarang"
						;;
					10)
						pacman -S --noconfirm digikam kipi-plugins
						;;
					11)
						pacman -S --noconfirm yakuake
						su -l $USERNAME --command="yaourt -S --noconfirm yakuake-skin-plasma-oxygen-panel"
						;;
					"a")
						su -l $USERNAME --command="yaourt -S --noconfirm plasma-theme-caledonia kdm-theme-caledonia ksplash-caledonia"
						su -l $USERNAME --command="yaourt -S --noconfirm kfaenza-icon-theme"
						#QtCurve Themes #{{{
						wget http://kde-look.org/CONTENT/content-files/144205-Sweet.tar.gz
						wget http://kde-look.org/CONTENT/content-files/141920-Kawai.tar.gz
						tar zxvf 144205-Sweet.tar.gz
						tar zxvf 141920-Kawai.tar.gz
						rm 144205-Sweet.tar.gz
						rm 141920-Kawai.tar.gz
						mkdir -p /home/$USERNAME/.kde4/share/apps/color-schemes
						mv Sweet/Sweet.colors /home/$USERNAME/.kde4/share/apps/color-schemes
						mv Kawai/Kawai.colors /home/$USERNAME/.kde4/share/apps/color-schemes
						mkdir -p /home/$USERNAME/.kde4/share/apps/QtCurve
						mv Sweet/Sweet.qtcurve /home/$USERNAME/.kde4/share/apps/QtCurve
						mv Kawai/Kawai.qtcurve /home/$USERNAME/.kde4/share/apps/QtCurve
						chown -R $USERNAME:users /home/$USERNAME/.kde4
						rm -fr Kawai Sweet
						#}}}
						pacman -S --noconfirm choqok
						pacman -S --noconfirm k3b dvd+rw-tools
						su -l $USERNAME --command="yaourt -S --noconfirm apper"
						su -l $USERNAME --command="yaourt -S --noconfirm minitube"
						su -l $USERNAME --command="yaourt -S --noconfirm musique"
						su -l $USERNAME --command="yaourt -S --noconfirm bangarang"
						pacman -S --noconfirm digikam kipi-plugins
						pacman -S --noconfirm yakuake
						su -l $USERNAME --command="yaourt -S --noconfirm yakuake-skin-plasma-oxygen-panel"
						LOOP=0
						;;
					*)
						LOOP=0
						;;
				esac
				finish_function
			done
			GNOME=0
			add_new_daemon "kdm"
			sumary "KDE installation"
			finish_function
			#}}}
			;;
		3)
			#XFCE #{{{
			print_title "XFCE - https://wiki.archlinux.org/index.php/Xfce"
			pacman -S --noconfirm xfce4 xfce4-goodies
			pacman -S --noconfirm gstreamer0.10-plugins
			su -l $USERNAME --command="yaourt -S --noconfirm automounter"
			GNOME=1
			sumary "XFCE installation"
			finish_function
			#}}}
			;;
	esac
	#networkmanager #{{{
	print_title "NETWORKMANAGER - https://wiki.archlinux.org/index.php/Networkmanager"
	question_for_answer "Install NetworkManager"
	case "$OPTION" in
		"y")
			if [ "$GNOME" -eq 1 ]; then
				pacman -S --noconfirm networkmanager network-manager-applet
			else
				pacman -S --noconfirm networkmanager kdeplasma-applets-networkmanagement
			fi
			groupadd networkmanager
			gpasswd -a $USERNAME networkmanager
			remove_daemon "network"
			add_new_daemon "@networkmanager"
			install_status
			;;
		*)
			CURRENT_STATUS=0
			;;
	esac
	sumary "NetworkManager installation"
	finish_function
	#}}}
#}}}
#developement #{{{
LOOP=1
while [ "$LOOP" -ne 0 ]
do
	print_title "DEVELOPMENT APPS"
	echo "[1] QT-Creator"
	echo "[2] Gvim"
	echo "[3] Emacs"
	echo "[4] Oracle Java"
	echo "[5] IntelliJ IDEA"
	echo "[6] Aptana Studio"
	echo "[7] Netbeans"
	echo "[8] Eclipse"
	echo "[9] Debugger Tools [Valgrind, Gdb, Splint, Tidyhtml, Pyflakes, Jsl, Meld]"
	echo "[10] MySQL Workbench"
	echo ""
	echo "[q] QUIT"
	echo ""
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
			pacman -S --noconfirm qtcreator qt-doc
			mkdir -p /home/$USERNAME/.config/Nokia/qtcreator/styles
			wget http://angrycoding.googlecode.com/svn/branches/qt-creator-monokai-theme/monokai.xml
			mv monokai.xml /home/$USERNAME/.config/Nokia/qtcreator/styles/
			chown -R $USERNAME:users /home/$USERNAME/.config
			;;
		2)
			pacman -Rdd --noconfirm vim
			pacman -S --noconfirm gvim wmctrl ctags
			#helmuthdu's vimrc
			git clone git://github.com/helmuthdu/vim.git
			mv vim /home/$USERNAME/.vim
			ln -sf /home/$USERNAME/.vim/vimrc /home/$USERNAME/.vimrc
			chown -R $USERNAME:users /home/$USERNAME/.vim
			chown $USERNAME:users /home/$USERNAME/.vimrc
			sed -i '/Icon/s/gvim/vim/g' /usr/share/applications/gvim.desktop
			;;
		3)
			pacman -S --noconfirm emacs
			;;
		4)
			pacman -Rdd --noconfirm jre7-openjdk
			pacman -Rdd --noconfirm jdk7-openjdk
			su -l $USERNAME --command="yaourt -S --noconfirm jdk"
			;;
		5)
			pacman -S --noconfirm intellij-idea-community-edition
			;;
		6)
			su -l $USERNAME --command="yaourt -S --noconfirm aptana-studio"
			;;
		7)
			pacman -S --noconfirm netbeans
			;;
		8)
			while [ "$LOOP" -ne 0 ]
			do
				print_title "ECLIPSE - https://wiki.archlinux.org/index.php/Eclipse"
				echo "[1] Eclipse Classic"
				echo "[2] Eclipse IDE for C/C++ Developers "
				echo "[3] Android Development Tools for Eclipse"
				echo "[4] Web Development Tools for Eclipse"
				echo "[5] PHP Development Tools for Eclipse"
				echo "[6] Python Development Tools for Eclipse"
				echo "[7] Aptana Studio plugin for Eclipse"
				echo "[8] Vim-like editing plugin for Eclipse"
				echo "[9] Git support plugin for Eclipse"
				echo ""
				echo "[b] BACK"
				echo ""
				read -p "Option: " OPTION
				case "$OPTION" in
					1)
						pacman -S --noconfirm eclipse
						;;
					2)
						pacman -S --noconfirm eclipse-cdt
						;;
					3)
						su -l $USERNAME --command="yaourt -S --noconfirm eclipse-android android-apktool android-sdk android-sdk-platform-tools android-udev"
						;;
					4)
						su -l $USERNAME --command="yaourt -S --noconfirm eclipse-wtp-wst"
						;;
					5)
						su -l $USERNAME --command="yaourt -S --noconfirm eclipse-pdt"
						;;
					6)
						su -l $USERNAME --command="yaourt -S --noconfirm eclipse-pydev"
						;;
					7)
						su -l $USERNAME --command="yaourt -S --noconfirm eclipse-aptana"
						;;
					8)
						su -l $USERNAME --command="yaourt -S --noconfirm eclipse-vrapper"
						;;
					9)
						su -l $USERNAME --command="yaourt -S --noconfirm eclipse-egit"
						;;
					*)
						LOOP=0
						;;
				esac
			done
			LOOP=1
			;;
		9)
			pacman -S --noconfirm valgrind gdb splint tidyhtml pyflakes meld
			su -l $USERNAME --command="yaourt -S --noconfirm jsl"
			;;
		10)
			su -l $USERNAME --command="yaourt -S --noconfirm mysql-workbench"
			;;
		*)
			LOOP=0
			;;
	esac
	finish_function
done
#}}}
#office #{{{
LOOP=1
while [ "$LOOP" -ne 0 ]
do
	print_title "OFFICE APPS"
	echo "[1] LibreOffice"
	echo "[2] Latex [Texmaker, Lyx]"
	echo "[3] CHM Viewer"
	echo "[4] Xmind"
	echo "[5] Wunderlist"
	echo "[6] GCStar"
	echo ""
	echo "[a] ALL"
	echo "[q] QUIT"
	echo ""
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
			pacman -S --noconfirm libreoffice-$LOCATION_LO libreoffice-{base,calc,draw,impress,math,writer} libreoffice-extension-presenter-screen libreoffice-extension-pdfimport libreoffice-extension-diagram
			su -l $USERNAME --command="yaourt -S --noconfirm hunspell-$LOCATION_GNOME"
			if [ "$GNOME" -eq 1 ]; then
				pacman -S --noconfirm libreoffice-gnome
			else
				pacman -S --noconfirm libreoffice-kde4
			fi
			;;
		2)
			pacman -S --noconfirm texlive-latexextra texlive-langextra
			pacman -S --noconfirm lyx texmaker
			su -l $USERNAME --command="yaourt -S --noconfirm abntex"
			su -l $USERNAME --command="yaourt -S --noconfirm latex-template-springer latex-template-ieee latex-beamer"
			;;
		3)
			if [ "$GNOME" -eq 1 ]; then
				pacman -S --noconfirm chmsee
			else
				pacman -S --noconfirm kchmviewer
			fi
			;;
		4)
			su -l $USERNAME --command="yaourt -S --noconfirm xmind"
			;;
		5)
			su -l $USERNAME --command="yaourt -S --noconfirm wunderlist"
			;;
		6)
			pacman -S --noconfirm gcstar
			;;
		"a")
			pacman -S --noconfirm libreoffice-$LOCATION_LO libreoffice-{base,calc,draw,impress,math,writer} libreoffice-extension-presenter-screen libreoffice-extension-pdfimport libreoffice-extension-diagram
			su -l $USERNAME --command="yaourt -S --noconfirm hunspell-$LOCATION_GNOME"
			if [ "$GNOME" -eq 1 ]; then
				pacman -S --noconfirm libreoffice-gnome
			else
				pacman -S --noconfirm libreoffice-kde4
			fi
			pacman -S --noconfirm texlive-latexextra texlive-langextra lyx texmaker
			su -l $USERNAME --command="yaourt -S --noconfirm abntex"
			su -l $USERNAME --command="yaourt -S --noconfirm latex-template-springer latex-template-ieee latex-beamer"
			if [ "$GNOME" -eq 1 ]; then
				pacman -S --noconfirm chmsee
			else
				pacman -S --noconfirm kchmviewer
			fi
			su -l $USERNAME --command="yaourt -S --noconfirm xmind"
			su -l $USERNAME --command="yaourt -S --noconfirm wunderlist"
			pacman -S --noconfirm gcstar
			LOOP=0
			;;
		*)
			LOOP=0
			;;
	esac
	finish_function
done
#}}}
#System Tools #{{{
LOOP=1
while [ "$LOOP" -ne 0 ]
do
	print_title "SYSTEM TOOLS APPS"
	echo "[1] Htop"
	echo "[2] Grsync"
	echo "[3] Wine"
	echo "[4] Virtualbox"
	echo ""
	echo "[a] ALL"
	echo "[q] QUIT"
	echo ""
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
			pacman -S --noconfirm htop
			;;
		2)
			pacman -S --noconfirm grsync
			;;
		3)
			pacman -S --noconfirm wine wine_gecko winetricks
			;;
		4)
			pacman -S --noconfirm virtualbox virtualbox-additions
			su -l $USERNAME --command="yaourt -S --noconfirm virtualbox-ext-oracle"
			modprobe vboxdrv
			groupadd vboxusers
			gpasswd -a $USERNAME vboxusers
			add_new_module "vboxdrv"
			;;
		"a")
			pacman -S --noconfirm htop
			pacman -S --noconfirm grsync
			pacman -S --noconfirm wine wine_gecko winetricks
			pacman -S --noconfirm virtualbox virtualbox-additions
			su -l $USERNAME --command="yaourt -S --noconfirm virtualbox-ext-oracle"
			modprobe vboxdrv
			groupadd vboxusers
			gpasswd -a $USERNAME vboxusers
			add_new_module "vboxdrv"
			LOOP=0
			;;
		*)
			LOOP=0
			;;
	esac
	finish_function
done
#}}}
#graphics #{{{
LOOP=1
while [ "$LOOP" -ne 0 ]
do
	print_title "GRAPHICS APPS"
	echo "[1] Inkscape"
	echo "[2] Gimp"
	echo "[3] Gimp-plugins"
	echo "[4] Blender"
	echo "[5] MComix"
	echo ""
	echo "[a] ALL"
	echo "[q] QUIT"
	echo ""
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
			pacman -S --noconfirm inkscape uniconvertor python2-numpy python-lxml
			su -l $USERNAME --command="yaourt -S --noconfirm sozi"
			;;
		2)
			pacman -S --noconfirm gimp
			;;
		3)
			su -l $USERNAME --command="yaourt -S --noconfirm gimp-paint-studio gimp-resynth gimpfx-foundry gimp-plugin-pandora gimp-plugin-saveforweb"
			;;
		4)
			pacman -S --noconfirm blender
			;;
		5)
			pacman -S --noconfirm mcomix
			;;
		"a")
			pacman -S --noconfirm gimp inkscape uniconvertor python2-numpy python-lxml blender mcomix
			su -l $USERNAME --command="yaourt -S --noconfirm gimp-paint-studio gimp-resynth gimpfx-foundry gimp-plugin-pandora gimp-plugin-saveforweb sozi"
			LOOP=0
			;;
		*)
			LOOP=0
			;;
	esac
	finish_function
done
#}}}
#Internet #{{{
LOOP=1
while [ "$LOOP" -ne 0 ]
do
	print_title "INTERNET APPS"
	echo "[1] Firefox"
	echo "[2] Thunderbird"
	echo "[3] Google-Chrome"
	echo "[4] Jdownloader"
	echo "[5] Google Earth"
	echo "[6] Dropbox"
	echo "[7] Teamviewer"
	echo "[8] Trasmission"
	echo ""
	echo "[a] ALL"
	echo "[q] QUIT"
	echo ""
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
			pacman -S --noconfirm firefox firefox-i18n-$LOCATION_GNOME flashplugin
			;;
		2)
			pacman -S --noconfirm thunderbird thunderbird-i18n-$LOCATION_GNOME
			;;
		3)
			pacman -S --noconfirm flashplugin
			su -l $USERNAME --command="yaourt -S --noconfirm google-chrome"
			;;
		4)
			su -l $USERNAME --command="yaourt -S --noconfirm jdownloader"
			;;
		5)
			su -l $USERNAME --command="yaourt -S --noconfirm google-earth"
			;;
		6)
			if [ "$GNOME" -eq 1 ]; then
				su -l $USERNAME --command="yaourt -S --noconfirm nautilus-dropbox"
			else
				su -l $USERNAME --command="yaourt -S --noconfirm kfilebox"
			fi
			;;
		7)
			su -l $USERNAME --command="yaourt -S --noconfirm teamviewer"
			;;
		8)
			if [ "$GNOME" -eq 1 ]; then
				su -l $USERNAME --command="yaourt -S --noconfirm transmission-gtk"
			else
				su -l $USERNAME --command="yaourt -S --noconfirm transmission-qt"
			fi
			;;
		"a")
			pacman -S --noconfirm firefox firefox-i18n-$LOCATION_GNOME flashplugin
			pacman -S --noconfirm thunderbird thunderbird-i18n-$LOCATION_GNOME
			su -l $USERNAME --command="yaourt -S --noconfirm google-chrome"
			su -l $USERNAME --command="yaourt -S --noconfirm jdownloader"
			su -l $USERNAME --command="yaourt -S --noconfirm google-earth"
			su -l $USERNAME --command="yaourt -S --noconfirm teamviewer"
			if [ "$GNOME" -eq 1 ]; then
				su -l $USERNAME --command="yaourt -S --noconfirm nautilus-dropbox"
				su -l $USERNAME --command="yaourt -S --noconfirm transmission-gtk"
			else
				su -l $USERNAME --command="yaourt -S --noconfirm kfilebox"
				su -l $USERNAME --command="yaourt -S --noconfirm transmission-qt"
			fi
			LOOP=0
			;;
		*)
			LOOP=0
			;;
	esac
	finish_function
done
#lamp #{{{
print_title "LAMP SERVER - APACHE, MYSQL & PHP + ADMINER\n# https://wiki.archlinux.org/index.php/LAMP"
question_for_answer "Install LAMP"
case "$OPTION" in
	"y")
		pacman -S --noconfirm apache mysql php php-apache php-mcrypt php-gd
		su -l $USERNAME --command="yaourt -S --noconfirm adminer"
		rc.d start httpd mysqld
		/usr/bin/mysql_secure_installation
		echo -e '\n# adminer configuration\nInclude conf/extra/httpd-adminer.conf' >> /etc/httpd/conf/httpd.conf
		echo -e 'application/x-httpd-php		php' >> /etc/httpd/conf/mime.types
		sed -i '/LoadModule dir_module modules\/mod_dir.so/a\LoadModule php5_module modules\/libphp5.so' /etc/httpd/conf/httpd.conf
		echo -e '\n# Use for PHP 5.x:\nInclude conf/extra/php5_module.conf\nAddHandler php5-script php' >> /etc/httpd/conf/httpd.conf
		sed -i 's/DirectoryIndex\ index.html/DirectoryIndex\ index.html\ index.php/g' /etc/httpd/conf/httpd.conf
		sed -i 's/public_html/Sites/g' /etc/httpd/conf/extra/httpd-userdir.conf
		sed -i '/mysqli.so/s/^;//' /etc/php/php.ini
		sed -i '/mysql.so/s/^;//' /etc/php/php.ini
		sed -i '/mcrypt.so/s/^;//' /etc/php/php.ini
		sed -i '/gd.so/s/^;//' /etc/php/php.ini
		sed -i '/skip-networking/s/^/#/' /etc/mysql/my.cnf
		su -l $USERNAME --command="mkdir -p ~/Sites"
		su -l $USERNAME --command="chmod 775 ~/ && chmod -R 775 ~/Sites"
		rc.d restart httpd mysqld
		add_new_daemon "httpd @mysqld"
		install_status
		;;
	*)
		CURRENT_STATUS=0
		;;
esac
echo ""
print_line
echo "The folder \"Sites\" has been created in your home"
echo "You can access your projects at \"http://localhost/~username\""
sumary "LAMP installation"
finish_function
#}}}
#}}}
#multimedia #{{{
LOOP=1
while [ "$LOOP" -ne 0 ]
do
	print_title "MULTIMEDIA APPS"
	echo "[1] Rhythmbox"
	echo "[2] Exaile"
	echo "[3] Banshee"
	echo "[4] Clementine"
	echo "[5] Amarok"
	echo "[6] Beatbox"
	echo "[7] Arista"
	echo "[8] Transmageddon"
	echo "[9] XBMC"
	echo "[10] VLC"
	echo "[11] MIDI Support"
	echo "[12] Codecs"
	echo ""
	echo "[q] QUIT"
	echo ""
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
			pacman -S --noconfirm rhythmbox
			;;
		2)
			pacman -S --noconfirm exaile
			;;
		3)
			pacman -S --noconfirm banshee
			;;
		4)
			pacman -S --noconfirm clementine
			;;
		5)
			pacman -S --noconfirm amarok
			;;
		6)
			su -l $USERNAME --command="yaourt -S --noconfirm beatbox-bzr"
			;;
		7)
			su -l $USERNAME --command="yaourt -S --noconfirm arista-transcoder"
			;;
		8)
			su -l $USERNAME --command="yaourt -S --noconfirm transmageddon"
			;;
		9)
			pacman -S --noconfirm xbmc
			;;
		10)
			pacman -S --noconfirm vlc
			if [ "$GNOME" -eq 0 ]; then
				pacman -S --noconfirm phonon-vlc
			fi
			;;
		11)
			su -l $USERNAME --command="yaourt -S --noconfirm timidity++ fluidr3"
			echo -e 'soundfont /usr/share/soundfonts/fluidr3/FluidR3GM.SF2' >> /etc/timidity++/timidity.cfg
			;;
		12)
			pacman -S --noconfirm gstreamer0.10-plugins
			su -l $USERNAME --command="yaourt -S --noconfirm libquicktime libdvdread libdvdnav libdvdcss cdrdao"
			if [ "$ARCHI" = "i686" ]; then
				su -l $USERNAME --command="yaourt -S --noconfirm codecs"
			else
				su -l $USERNAME --command="yaourt -S --noconfirm codecs64"
			fi
			;;
		*)
			LOOP=0
			;;
	esac
	finish_function
done
#}}}
#Games #{{{
LOOP=1
while [ "$LOOP" -ne 0 ]
do
	print_title "GAMES - https://wiki.archlinux.org/index.php/Games"
	echo "[1] Action/Adventure"
	echo "[2] Arcade/Platformer"
	echo "[3] Dungeon"
	echo "[4] FPS"
	echo "[5] MMO"
	echo "[6] Puzzle"
	echo "[7] Simulation"
	echo "[8] Strategy"
	echo "[9] Racing"
	echo "[10] RPG"
	echo "[11] Emulators"
	echo ""
	echo "[q] QUIT"
	echo ""
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "ACTION AND ADVENTURE"
			echo "[1] Astromenace"
			echo "[2] OpenTyrian"
			echo "[3] M.A.R.S."
			echo "[4] Yo Frankie!"
			echo "[5] Counter-Strike 2D"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					su -l $USERNAME --command="yaourt -S --noconfirm astromenace"
					;;
				2)
					su -l $USERNAME --command="yaourt -S --noconfirm opentyrian-hg"
					;;
				3)
					su -l $USERNAME --command="yaourt -S --noconfirm mars-shooter"
					;;
				4)
					su -l $USERNAME --command="yaourt -S --noconfirm yofrankie"
					;;
				5)
					su -l $USERNAME --command="yaourt -S --noconfirm counter-strike-2d"
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		2)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "ARCADE AND PLATFORMER"
			echo "[1] Opensonic"
			echo "[2] Frogatto"
			echo "[3] Bomberclone"
			echo "[4] Goonies"
			echo "[5] Neverball"
			echo "[6] Super Mario Chronicles"
			echo "[7] X-Moto"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					su -l $USERNAME --command="yaourt -S --noconfirm opensonic"
					;;
				2)
					pacman -S --noconfirm frogatto
					;;
				3)
					pacman -S --noconfirm bomberclone
					;;
				4)
					su -l $USERNAME --command="yaourt -S --noconfirm goonies"
					;;
				5)
					pacman -S --noconfirm neverball
					;;
				6)
					pacman -S --noconfirm smc
					;;
				7)
					pacman -S --noconfirm xmoto
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		3)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "DUNGEON"
			echo "[1] Tales of Maj'Eyal"
			echo "[2] Lost Labyrinth"
			echo "[3] S.C.O.U.R.G.E."
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					su -l $USERNAME --command="yaourt -S --noconfirm tome4"
					;;
				2)
					su -l $USERNAME --command="yaourt -S --noconfirm lostlabyrinth"
					;;
				3)
					su -l $USERNAME --command="yaourt -S --noconfirm scourge"
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		4)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "FPS"
			echo "[1] World of Padman"
			echo "[2] Warsow"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					su -l $USERNAME --command="yaourt -S --noconfirm worldofpadman"
					;;
				2)
					pacman -S --noconfirm warsow
					;;
				3)
					pacman -S --noconfirm alienarena
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		5)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "MMO"
			echo "[1] Heroes of Newerth"
			echo "[2] Spiral Knights"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					su -l $USERNAME --command="yaourt -S --noconfirm hon"
					;;
				2)
					su -l $USERNAME --command="yaourt -S --noconfirm spiral-knights"
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		6)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "PUZZLE"
			echo "[1] Numptyphysics"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					su -l $USERNAME --command="yaourt -S --noconfirm numptyphysics-svn"
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		7)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "SIMULATION"
			echo "[1] Simultrans"
			echo "[2] Theme Hospital"
			echo "[3] OpenTTD"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					su -l $USERNAME --command="yaourt -S --noconfirm simutrans"
					;;
				2)
					su -l $USERNAME --command="yaourt -S --noconfirm corsix-th"
					;;
				3)
					pacman -S --noconfirm openttd
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		8)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "STRATEGY"
			echo "[1] Wesnoth"
			echo "[3] 0ad"
			echo "[4] Hedgewars"
			echo "[5] Warzone 2100"
			echo "[6] MegaGlest"
			echo "[7] Zod"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					question_for_answer "Install Devel Version"
					case "$OPTION" in
						"y")
							su -l $USERNAME --command="yaourt -S --noconfirm wesnoth-devel"
							;;
						*)
							pacman -S --noconfirm wesnoth
							;;
					esac
					;;
				3)
					su -l $USERNAME --command="yaourt -S --noconfirm 0ad"
					;;
				4)
					pacman -S --noconfirm hedgewars
					;;
				5)
					pacman -S --noconfirm warzone2100
					;;
				6)
					pacman -S --noconfirm megaglest
					;;
				7)
					su -l $USERNAME --command="yaourt -S --noconfirm commander-zod"
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		9)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "RACING"
			echo "[1] Maniadrive"
			echo "[2] Death Rally"
			echo "[3] SupertuxKart"
			echo "[4] Speed Dreams"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					su -l $USERNAME --command="yaourt -S --noconfirm maniadrive"
					;;
				2)
					su -l $USERNAME --command="yaourt -S --noconfirm death-rally"
					;;
				3)
					pacman -S --noconfirm supertuxkart
					;;
				4)
					pacman -S --noconfirm speed-dreams
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		10)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "RPG"
			echo "[1] Ardentryst"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					su -l $USERNAME --command="yaourt -S --noconfirm ardentryst"
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		11)
		#{{{
		while [ "$LOOP" -ne 0 ]
		do
			print_title "RPG"
			echo "[1] ZSNES"
			echo ""
			echo "[b] BACK"
			echo ""
			read -p "Option: " OPTION
			case "$OPTION" in
				1)
					pacman -S --noconfirm zsnes
					;;
				*)
					LOOP=0
					;;
			esac
		done
		LOOP=1
		;;
		#}}}
		*)
		LOOP=0
		;;
	esac
done
finish_function
#}}}
#fonts #{{{
LOOP=1
while [ "$LOOP" -ne 0 ]
do
	print_title "FONTS - https://wiki.archlinux.org/index.php/Fonts"
	echo "[1] ttf-ms-fonts"
	echo "[2] ttf-dejavu"
	echo "[3] ttf-liberation"
	echo "[4] ttf-kochi-substitute (Japanese Support)"
	echo "[5] ttf-google-webfonts"
	echo "[6] ttf-roboto"
	echo ""
	echo "[a] ALL"
	echo "[q] QUIT"
	echo ""
	read -p "Option: " OPTION
	case "$OPTION" in
		1)
			su -l $USERNAME --command="yaourt -S --noconfirm ttf-ms-fonts"
			;;
		2)
			pacman -S --noconfirm ttf-dejavu
			;;
		3)
			pacman -S --noconfirm ttf-liberation
			;;
		4)
			su -l $USERNAME --command="yaourt -S --noconfirm ttf-kochi-substitute"
			;;
		5)
			pacman -Rdd --noconfirm ttf-ubuntu-font-family ttf-droid
			su -l $USERNAME --command="yaourt -S --noconfirm ttf-google-webfonts"
			;;
		6)
			su -l $USERNAME --command="yaourt -S --noconfirm ttf-roboto"
			;;
		"a")
			pacman -Rdd --noconfirm ttf-ubuntu-font-family ttf-droid
			su -l $USERNAME --command="yaourt -S --noconfirm ttf-ms-fonts ttf-dejavu ttf-liberation ttf-kochi-substitute ttf-roboto ttf-google-webfonts"
			LOOP=0
			;;
		*)
			LOOP=0
			;;
	esac
	finish_function
done
print_title "FONTS CONFIGURATION - https://wiki.archlinux.org/index.php/Font_Configuration"
question_for_answer "Install ubuntu patched (cairo, fontconfig, freetype and libxft) packages"
case "$OPTION" in
	"y")
		pacman -Rdd --noconfirm cairo fontconfig freetype2 libxft
		su -l $USERNAME --command="yaourt -S --noconfirm cairo-ubuntu fontconfig-ubuntu freetype2-ubuntu"
		;;
	*)
		CURRENT_STATUS=0
		;;
esac
sumary "Ubuntu Patched Fonts Configuration installation"
finish_function
#}}}
#reboot #{{{
print_title "INSTALL COMPLETED"
question_for_answer "Reboot now?"
case "$OPTION" in
	"y")
		echo "Thanks for using the Ultimate Arch install script by helmuthdu"
		echo "Your Computer will now restart"
		finish_function
		reboot
		exit 0
		;;
	*)
		echo "Thanks for using the Ultimate Arch install script by helmuthdu"
		exit 0
		;;
esac
#}}}
#}}}

以上是关于sh 最终的Arch Linux安装脚本的主要内容,如果未能解决你的问题,请参考以下文章

sh 列表打包安装在Arch Linux中(base / base-devel除外)

sh 具有ARCH或FULL选项的常规备份脚本

Arch Linux 安装简易教程

sh arch linux清理垃圾

sh 要在构建阶段添加的脚本,以便删除FAT框架中未使用的arch。 (Xcode中)

sh 用于修复(Arch)Linux中的蓝牙问题的命令