How can I change the shutdown menu?
#1
Hello,

I just wonder how can I change the shutdown menu in confluence.

The reason for that is: I have a distributed set up with xbmc players and a media server and I want to add a menu item to the shutdown dialog, that invokes a remote shutdown of my filer / server. I also need another command that invokes a windows program for my rf-controlled power switch (ON / OFF, USB dongle with a program included, that can do the trick) to remotely turn on / off my other equipment (e.g. my router, my network switches, beamer etc.)

To make a long talk short: is there a way to modify that pop-up window - and if not - is there a way to extend the gui / skin of xbmc with custom windows commands (launch a script or application with arguments) or maybe a guide how to do this things?

Thank you very much!
Reply
#2
The shutdown dialog is defined in DialogButtonMenu.xml, which you'll find in "C:\Program Files\XBMC\addons\skin.confluence\720p" if you installed XBMC into the default folder. However modifying it is not a trivial exercise.

I would write a script to do the things you want. You can run the script by mapping it to a key or by turning it into an addon and running it from the Programs section. If you want some example scripts there are a few on http://swarchive.ratsauce.co.uk/XBMC/

JR
Reply
#3
Thanks a lot.

Some new entries in DialogButtonMenu.xml and Events :

<onclick> System.Exec("")</onclick>

have done the trick whithout a custom script or plugin.

Thank you very much for the hint.
Reply
#4
Any chance you could expand on how you solved this problem please? I am looking to do something very similar with other machines on my network, essentially running a batch file from a menu item that launches a "shutdown -f -s -m \\ip.address" command to shutdown other machines from xbmc. If I could incorporate the chosen commands into the shutdown sub menu that would be perfect.

Thanks.
Reply
#5
DialogButtonMenu.xml is an XML file that defines the skin layout and also the actions when you click any control on the screen. The XML in this file is not intended to be human readable, so it isn't commented and you have to find the bits you want by trial and error. In the case of the "shutdown" button, searching the Confluence version of this file finds;

Code:
<control type="button" id="15">
  <description>Shutdown button</description>
  ...
  <onclick>XBMC.Shutdown()</onclick>

The <onclick> tag indicates what action will be taken when you click that control. In this case the action is "XBMC.Shutdown()" and this shuts down XBMC. A list of the possible functions is given in http://wiki.xbmc.org/?title=List_of_Built_In_Functions

In your case you'd probably want to change the action to "XBMC.RunScript(somescript.py)". Then you can write the Python script somescript.py to do whatever you want.

JR
Reply
#6
Thanks for the info...I figured it might involve scripts or python and to be honest I haven't got into any of that just yet. Guess I was hoping there might have been any easy way to add custom menu functions.
Reply
#7
Patch highlitet file (xml):


C:\Program Files (x86)\XBMC\addons\skin.confluence\720p\DialogButtonMenu.xml

Code:
...
                <label>13012</label>
                <visible>System.ShowExitButton</visible>
            </control>
            <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>
                <visible>System.CanPowerDown</visible>
                <pulseonselect>no</pulseonselect>
                <font>font13</font>
                <label>13016</label>
            </control>
[b]            <control type="button" id="333">
                <description>Shutdown Server 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>System.Exec("c:\\mynasserver.bat")</onclick>
                <onclick>XBMC.Powerdown()</onclick>
                <visible>System.CanPowerDown</visible>
                <pulseonselect>no</pulseonselect>
                <font>font13</font>
                <label>Power Off HTPC & Server</label>
            </control>[/b]
            <control type="button" id="4">
                <description>Custom Shutdown Timer</description>

...

Create the batch file for the shutdown. you can add more computers or different other stuff in it, if you need...
That's all. A dos-box flashes for a second while the file is called and both, the remote filer and the htpc go down cleanly.

c:\mynasserver.bat

Code:
c:\windows\system32\shutdown.exe /s /m \\mynasserver /t 000 /f /c bye
Reply
#8
Hi,

great action! I would like to make almost the same and you helped me a lot.

I would like to have an option at the shutdown dialog to just power off the xbmc or xbmc & file server (which i start with WOL over xbmc start up)
But actually i'm running a windows client as xbmc 13.1 and a linux file server.
So i would like to ask if somebody has any idea how i easily can send the shutdown via xbmc power off to my linux server. I suppose i need an external tool for it and would like to catch some of your ideas.

best regards
Dirk
Reply

Logout Mark Read Team Forum Stats Members Help
How can I change the shutdown menu?1