Shutdown computer via XBMC
#16
what you need to do is open up DialogButtonMenu.xml (in Project Mayhem 3) find the shutdown button which is started at <control type="button" id="3112"> and change this
<onclick>XBMC.ShutDown()</onclick>
to this
<onclick>System.Exec(shutdown -h now)</onclick>
Of course you will have to be a root user for this to work or make shutdown work so non root people can
Reply
#17
I'm getting this:
Code:
Keymapping error: no such action 'system.exec(shutdown -h now)' defined

and nothing happens....
Reply
#18
[quote=Duduke]I'm getting this:
Code:
Keymapping error: no such action 'system.exec(shutdown -h now)' defined

and nothing happens....[/QUOTElocate shutdown on linux then its

eg.. system.exec(/bin/shutdown -h now)
Reply
#19
same thing, i'm still getting the keymap.xml error...
Reply
#20
Works fine for me :\ maybe you edited it wrong because its got nothing to do with keymap.xml
Reply
#21
Did you put the command in quotes like yuvalt's example? ie system.exec("command") ?

Also, shutdown is usually in /sbin/ and requires root access to execute.
Reply
#22
You can add the XBMC user to sudoers with visudo to execute /sbin/shutdown with the NOPASSWD flag. That'd work.
Reply
#23
rodalpho Wrote:You can add the XBMC user to sudoers with visudo to execute /sbin/shutdown with the NOPASSWD flag. That'd work.

I added the following line with visudo:
ALL ALL = NOPASSWD:/sbin/shutdown

which allows me to execute #sudo shutdown -h now
without prompting for a password

I also made the change to the DialogButtonMenu.xml file listed above with the exception of adding sudo to the command. I made the change to both xml files in PAL and PAL16x9 directory.

However, it still just shuts down XBMC and goes back to the desktop.

Any ideas?
Reply
#24
Well if you put the pound sign in front of it you commented it out, which won't work. Beyond that if it works from the commandline it's a XBMC issue not a linux one, and I'm not qualified to help further.

Also you allowed all users to run shutdown which may not be a great idea. But I guess most people don't have multiple users so it wouldn't much matter.
Reply
#25
rodalpho Wrote:Well if you put the pound sign in front of it you commented it out, which won't work. Beyond that if it works from the commandline it's a XBMC issue not a linux one, and I'm not qualified to help further.

Also you allowed all users to run shutdown which may not be a great idea. But I guess most people don't have multiple users so it wouldn't much matter.

No, I put a pound sign there to show that I could execute from a command line, I didn't put one in the xml file.

My xbmc box is only for htpc and there is only one user, so ALL is irrelevant.
Reply
#26
Try "/usr/bin/gnome-power-cmd.sh shutdown" This should do the trick as normal user. You can also use "suspend" as argument...
Reply
#27
NEI Wrote:Try "/usr/bin/gnome-power-cmd.sh shutdown" This should do the trick as normal user. You can also use "suspend" as argument...

Ahh dude you rock I was trying to figure out how to get suspend working

I take it back seems linux dosn't like going into suspend when xbmc is in fullscreen
Reply
#28
Quote:I take it back seems linux dosn't like going into suspend when xbmc is in fullscreen
You can define scripts in /etc/acpi/suspend.d/ or soemthing, can't remember the exact path and I'm not at the machine right now. So you could stop xbmc before suspending and in /etc/acpi/resume.d/ you could start it again. Did not test this though, as my suspend is not working like I would like... ;-)
Reply
#29
NEI Wrote:You can define scripts in /etc/acpi/suspend.d/ or soemthing, can't remember the exact path and I'm not at the machine right now. So you could stop xbmc before suspending and in /etc/acpi/resume.d/ you could start it again. Did not test this though, as my suspend is not working like I would like... ;-)

I would love to be able to suspend and wake up from remote. But for the time being, if I could just shut down from remote I'd be happy.

Does anyone have this working? Changing the command from a xbmc shutdown to a system shutdown in DialogButtonMenu.xml seemed to oddly have no effect as it still shuts down xbmc only. I haven't tried the previous posts on using keymap to send a system shutdown command so I guess I'll try that next, but using the DialogButton seemed like a cleaner way to do it.
Reply
#30
rrambo no effect at all might because because you edited the wrong file there is a file in Pal and Pal16x9 (in PM3 skin ) and you need to edit the one that you use
Reply

Logout Mark Read Team Forum Stats Members Help
Shutdown computer via XBMC0