#! /bin/bash

minecraft="https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft.jar"

User="nobody"

echo "Benutzername"
read User



mkdir /home/$User/.minecraft

chown $User:users /home/$User/.minecraft

mcdir=/home/$User/.minecraft

echo "minecraft.jar Downloaden"
wget -q https://s3.amazonaws.com/MinecraftDownload/launcher/minecraft.jar -O $mcdir/minecraft_install.jar

chown $User:users $mcdir/minecraft_install.jar
chmod +x $mcdir/minecraft_install.jar

echo "Mincraft icon downloaden"
wget -q http://img.webme.com/pic/m/minec-deinc/minecraft_icon.png -O $mcdir/icon.png

chown $User:users $mcdir/icon.png

echo "Minecraft Installieren"

echo -e "#! /bin/bash \n\ncd $mcdir \njava -jar minecraft_install.jar" > $mcdir/minecraft.sh

chown $User:users $mcdir/minecraft.sh
chmod +x $mcdir/minecraft.sh

echo -e "[Desktop Entry]\nComment[de]=\nComment=\nExec=$mcdir/minecraft.sh\nGenericName[de]=\nGenericName=\nIcon=$mcdir/icon.png\nMimeType=\nName[de]=Minecraft\nName=Minecraft\nPath=\nStartupNotify=true\nTerminal=false\nTerminalOptions=\nType=Application\nX-DBUS-ServiceName=\nX-DBUS-StartupType=\nX-KDE-SubstituteUID=false\nX-KDE-Username=\nX-SuSE-translate=true" > /home/$User/Arbeitsfläche/Minecraft.desktop


