Articles

Gentoo XBMC Post-Setup

In Uncategorized on 18/04/2011 by pier0w

The very last thing to do is get XBMC to start up automatically on boot.

To do this we will make it so that the xbmc user starts XBMC automatically when ever they login locally to the laptop.

So first get the xbmc user to start X11 on a local login by adding the following to the end of the users .bashrc file.

...
# Put your fun stuff here.
LOGIN_TYPE=`tty | awk '{if(match($0, /pts/)){print "SSH"}else{print "LOCAL"}}'`

if [ $LOGIN_TYPE == "LOCAL" ]
then
        exec startx
fi

unset LOGIN_TYPE

This little bit of script will only start X11 if the user logs in locally.

Next create a file called .xinitrc in the root of the user home directory, anything within this file will be executed by X11 right after it starts up. So this is where we will place the start up of XBMC.

.xinitrc:
#!/bin/bash

exec /usr/bin/xbmc

Now this should work fine if you chose to configure X11 to either ignore or turn off the laptop monitor, but if you did neither of those then you tell XBMC to start up twice. This is because on the first start up it will get the resolution conpletely wrong, but once you close it down then start it again the resolution will be right.

.xinitrc:
#!/bin/bash

xbmc
xbmc

Now get Gentoo to login to the xbmc use on boot, this can be done within the /etc/conf.d/local.start file which is a file that will always be executed at the end of Gentoo’s boot process.

/etc/conf.d/local.start:
# /etc/conf.d/local.start

# This is a good place to load any misc programs
# on startup (use &>/dev/null to hide output)

su - xbmc

So with that all done XBMC is all setup and ready to use.

Link for getting shutdown to work.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: