provides runXBMC.sh (chmod +x runXBMC.sh)
save in /usr/bin/runXBMC.sh
Code:
#!/bin/bash
if [ "$(pidof X)" ] ; then
/usr/share/xbmc/xbmc.bin --standalone
exit
fi
while true
do
echo "#!/bin/bash" > /home/xbmc/.xinitrc
echo "/usr/share/xbmc/xbmc.bin --standalone" >> /home/xbmc/.xinitrc
echo "case \"\$?\" in" >> /home/xbmc/.xinitrc
echo " 0 ) # Quit" >> /home/xbmc/.xinitrc
echo " touch /tmp/noRestartXBMC" >> /home/xbmc/.xinitrc
echo " break ;;" >> /home/xbmc/.xinitrc
echo " 64 ) # Shutdown System" >> /home/xbmc/.xinitrc
echo " sleep 10 ;;" >> /home/xbmc/.xinitrc
echo " 65 ) # Warm Reboot" >> /home/xbmc/.xinitrc
echo " echo "Restarting XBMC ..." ;;" >> /home/xbmc/.xinitrc
echo " 66 ) # Reboot System" >> /home/xbmc/.xinitrc
echo " sleep 10 ;;" >> /home/xbmc/.xinitrc
echo " * ) ;;" >> /home/xbmc/.xinitrc
echo "esac" >> /home/xbmc/.xinitrc
chown xbmc:xbmc /home/xbmc/.xinitrc
if [ "$(whoami)" == "root" ] ; then
su xbmc -c "startx -- -br > /dev/null 2>&1" -l
else
startx -- -br > /dev/null 2>&1
fi
if [ -e /tmp/noRestartXBMC ] ; then
rm /tmp/noRestartXBMC
rm /home/xbmc/.xsession
break
fi
#sleep 2
done
Few gotchas here. Assumes user xbmc. Assumes xbmc is installed to /usr/share/xbmc.
You may need to change this pathand or user accordingly. I cant test this script as I dont currently have an Arch / xbmc install. I hope this at lease shows you how it can be done. It may also be useful to download the xbmc-live ubuntu package and unarchive so you can take a little peek and compare.
You'll need to revert your inittab back to default and set run level to 3.
Let me know how you go with it.
If it does work, you should be able to exit out of xbmc. You can also stop|start|restart xbmc via ssh with
# /etc/rc.d/xbmc stop | start | restart