below is a script I used to use
I have commented out ( but not tested ) the ps3 controller bits I used.
essentially has two modes, online and offline
Minecraft.sh
You get the login screen
Minecraft.sh Steve
you play offline , playername Steve ( skips the normal login screen )
Code:
#!/bin/bash
# Minecraft.sh
JavaMem=1024
autokey=autokey-gtk
Minecraft=$HOME/.minecraft
#TODO add some magic to manage .minecraft, plus manage versions and mods
Sixad () {
sudo service bluetooth stop
sudo /etc/init.d/sixad start
}
# Sixaxis Deamon
#ps -e | grep -q sixad || Sixad
#pidof $autokey || coproc $autokey
### above commented out for LQ posting
# sixad is a driver for ps3 controller
# autokey monitors 'events' I use it to map mouse wheel events to the ps3 controller
# ( by mapping 'dead keys' F20 and F21 ) to keys on the PS3Controller.
# when autokey 'sees' these it sends a mouse wheel up/down
Online () {
# MineCraft
pidof minecraft.jar || \
coproc java -Xmx${JavaMem}M \
-Xms$(( ${JavaMem} / 2))M \
-cp $Minecraft/minecraft.jar \
net.minecraft.LauncherFrame
}
Offline () {
pushd $Minecraft
pidof minecraft.jar || \
coproc java -Xmx${JavaMem}M -Xms$(( {JavaMem} / 2))M \
-cp $Minecraft/bin/minecraft.jar:$Minecraft/bin/lwjgl.jar:\
$Minecraft/bin/lwjgl_util.jar:\
$Minecraft/bin/jinput.jar: \
-Djava.library.path=$Minecraft/bin/natives net.minecraft.client.Minecraft $MCUSERNAME
popd
}
if [ "$#" != "0" ];
then
#if [ "$1" == "-r" ];
#then
# sudo /etc/init.d/sixad stop
# sudo /etc/init.d/sixad start
# MCUSERNAME=$2
#else
MCUSERNAME=$1
#fi # commented out for LQ post
# sometimes sixad would 'die' ( if left inactive ) so was just a quick hack to restart it
Offline
else
Online
fi
save as ~/bin/Minecraft.sh
and in terminal
Code:
chmod 700 ~/bin/Minecraft.sh
Minecraft.sh
the chmod is only needed the once, in future just Minecraft.sh [PlayerName]
you might want to tweak JavaMem=1024 ( max 1GB memory, and starts with half (512MB) )