So I've got XBMC (XBian), a desktop (LXDE), Spotify (despotify) and internet browser (Chromium) all working very nicely on the Pi.. I've added some tweaks to use runlevels to allows the ability to just click an icon to flick from XBMC to Desktop and back.. Meaning no terminal commands are needed (well apart from despotify).. This was for the little lady after all, so needed to be simple..

I searched round for a while trying to work out the best way to do this.. I have tried a few ways.. I think this seems to be the best... I only install what I need to keep the footprint and boot times minimal with a focus on XBMC for performance..
As it took me a while to tweak to my liking and because I now have a script that I can just run on a new image.. I thought I should share the instructions.. So I will break down my script to try and help you out, if this is what you are after anyway...
So first off grab XBian from here http://xbian.org/. I use the XBian 1.0 Alpha and have incorporated many of the fixes they have posted to be initially called by my script, so it takes the 1.0 Alpha image and upgrades it. I am not going to list all them, have a look on github https://github.com/Koenkk/Xbian/issues?state=open. If you are unsure just use the latest stable release. Currently XBian 0.8.3.
So once you have your image burnt to SD card, set it up how you want... I have some extra partitions, using a 16GB card. It is not required.. You will obviously need a way to type into terminal, either keyboard or ssh... If you chose the Alpha, check their wiki and upgrade and put any fixes you may need. You want to know XBMC is working don't you?
Also good idea to update/upgrade etc now:
Code: Select all
sudo apt-get clean
sudo apt-get update
sudo apt-get upgrade -y
Code: Select all
echo "Installing xorg...."
sudo apt-get install xorg -y
echo "Installing LXDE......."
sudo apt-get install lxde-core --no-install-recommends -y
# To be able to reboot from logout menu we need
sudo apt-get install upower -y
sudo apt-get install lxde-icon-theme -y
echo "Adding lxterminal.........."
sudo apt-get install lxterminal -y
So I wanted a browser.. I like Chromium (thanks to Hexxeh http://hexxeh.net/), enables sync with Google account... But you can install whatever you want..
Code: Select all
echo "Installing Chromium browser"
## This is NOT my work, it is Hexxeh - http://hexxeh.net/
sudo apt-get install -y --force-yes libnss3 libxrender1 libxss1 libgtk2.0-0 libgconf2-4
sudo mkdir -p /opt/google/
cd /opt/google
sudo wget http://distribution-eu.hexxeh.net/chromium-rpi/chromium-rpi-r22.tar.gz -O chromium-rpi.tar.gz
sudo tar xvf chromium-rpi.tar.gz
sudo chown root:root chrome/chrome-sandbox
sudo chmod 4755 chrome/chrome-sandbox
sudo rm -rf /usr/bin/chrome
sudo ln -s /opt/google/chrome/chrome /usr/bin/chrome
So now, spotify... Again great work from Hexxeh http://hexxeh.net/... Although there are some pre-requisites, as just trying to make from his instructions errors as we are missing things.. Of course we don't even have 'make' yet.. So here we go:
Code: Select all
## Pre-requisites
#Need Make
echo "Installing despotify pre-requisites..."
sudo apt-get install make gcc -y
# Make the libs
cd /opt/vc/src/hello_pi
sudo make -C libs/ilclient
# Make audio
cd hello_audio
sudo make
# symlink libs to correct place for hexxeh's despotify
cd /opt/vc/include/interface/vcos
sudo ln -s ./pthreads/vcos_platform_types.h
sudo ln -s ./pthreads/vcos_platform.h
cd /opt/vc/src/hello_pi/libs/
sudo ln -s ./ilclient/ilclient.h
sudo ln -s ./ilclient/libilclient.a
Code: Select all
## This is NOT my work, it is Hexxeh - http://hexxeh.net/
echo "Installing despotify....."
cd ~
sudo apt-get install libtool git libssl-dev libmpg123-dev libvorbis-dev libncursesw5-dev -y
git clone git://github.com/Hexxeh/despotify.git -b raspberrypi
cd despotify/src
sudo make
So exit XBMC and type 'startx' to get to desktop..
On your desktop you can add icons for spotify, chromium etc..
Reboot from desktop and you should find yourself back in XBMC..
I have scripted all my customisations.. They run after the stuff I explain above.
I change XBMC to only run in the default runlevel (2)
I use advanced launcher to call a script which updates inittab to change the defaul runlevel (to 5) and then reboot the machine..
Added a script that is setup to only run in runlevel 5, which auto launches the desktop and updates inittab back to runlevel 2.
So then when I reboot from desktop I am back in XBMC..
A few tweaks to desktop:
added spotify desktop icon, which runs a script in background to auto log in
added a chromium desktop icon so can disable ipv6 and have google as home page
I also created a MySql server on my windows machine so the database is centralised for any XBMC... Also put the thumbnails all there too, so my Movies, TV & Music database is just one centralised.. Only got two XBMC's running at the moment, but they are in sync and I will add more.. I like the ability to stop on one and continue where you left off in another room..

Next - I may look to change memory split as part of the switch to desktop.. maybe speed it up a little, but remember to change it back for XBMC
Simples...

The runlevels stuff only works in Alpha as 0.8.3 used profile rather than runlevels (although its still possible with 0.8.3 - i had it working there first)..
If people are interested I can add extra details for what I do with the runlevel for ease of switching.. There are other ways to do it though..
Erm, that's it.. I am a bit of a noob to all this, so hope it is of interest/use to someone.. Post and let me know if so.. It is my first post/blog after all...
North3221