Raspberry PI - XBMC shutdown system

Oscar Brito




To make the XBMC shutdown the system follow the instructions, and remember that the user running
XBMC must have sudo permissions ( will do just for now !!! ).


> vim /usr/share/xbmc/addons/skin.confluence/720p/DialogButtonMenu.xml

Change the button with "Shutdown button" description:

                       <control type="button" id="3">
                                <description>Shutdown button</description>
                                <width>340</width>
                                <height>40</height>
                                <textcolor>grey2</textcolor>
                                <focusedcolor>white</focusedcolor>
                                <align>center</align>
                                <textwidth>290</textwidth>
                                <texturefocus border="25,5,25,5">ShutdownButtonFocus.png</texturefocus>
                                <texturenofocus border="25,5,25,5">ShutdownButtonNoFocus.png</texturenofocus>
                                <!--<onclick>XBMC.Powerdown()</onclick>-->
                                <onclick>System.exec("/usr/share/xbmc/scripts/shutdown.sh")</onclick>
                                <visible>System.CanPowerDown</visible>
                                <pulseonselect>no</pulseonselect>
                                <font>font13</font>
                                <label>13016</label>
                        </control>



> mkdir /usr/share/xbmc/scripts/

> vim /usr/share/xbmc/scripts/shutdown.sh

#!/bin/sh

sudo /etc/init.d/xbmc stop
sudo sync
sudo poweroff -f

> chmod +x /usr/share/xbmc/scripts/shutdown.sh

Just remember that you have hacked the skin UI, so if you install a new skin the same recipe must be applied.

And there it is. Powering off the XBMC will poweroff the system.



Visit www.divhide.com for more informations, contacts and news about Web Development.
See other blog posts at blog.divhide.com.



Divhide purpose is to follow the HTML5 movement and contribute with applications which prove the quality of technology.


Feel free to contact divhide.