Shutdown computer via XBMC
#46
Thank you for the reply. Unfortunately XBMC.restartapp() does nothing at all. Even when I select Restart XBMC on the Shutdown Menu, the menu just disappears, Thanks for looking into this. A solution would be greatly appreciated. I hope you enjoy your vacation!

Thank again.
Reply
#47
Bumping this as since Beta1 we have decided to add the following commands
XBMC.Shutdown() - Will trigger your default behaviour (setup in settings -> system)
XBMC.Quit() - Will quit XBMC
XBMC.Powerdown() - Will shutdown the system
XBMC.Suspend() - will suspend the system
XBMC.Hibernate() - Will hibernate the system
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#48
Topfs2 Wrote:Bumping this as since Beta1 we have decided to add the following commands
XBMC.Shutdown() - Will trigger your default behaviour (setup in settings -> system)
XBMC.Quit() - Will quit XBMC
XBMC.Powerdown() - Will shutdown the system
XBMC.Suspend() - will suspend the system
XBMC.Hibernate() - Will hibernate the system

Hi Topfs2,

Could you please help me out on how can I find out the way XBMC.Suspend() command suspending the computer? To be more specific, I am wondering which linux commands (srcipts) are used by default.

Thank you!
Reply
#49
it's all done through dbus
Reply
#50
spiff Wrote:it's all done through dbus

Thanks spiff, but could you please also assist me, that in which file can I find the exact commands?
Reply
#51
We don´t use any scripts for it but rather issue the commands directly onto dbus as spiff said.

However there is an app that does this aswell called dbus-send.

Here is how you do what we do when doing a powerstate change.

https://wiki.ubuntu.com/DebuggingGNOMEPowerManager

This is more or less exactly what is done when doing a sleep call
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0

And if you need references one how to do the commands via cpp you can check
xbmc/linux/HalManager.cpp
namely method PowerManagement @ line 390

When I did the HalManager I based it ontop of Gnome Volume Manager so thats a great reference aswell (not that it deals with dbus that much and it only handle volumes but still a good read on HAL)

Cheers,
Tobias
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#52
Topfs2 Wrote:We don´t use any scripts for it but rather issue the commands directly onto dbus as spiff said.

However there is an app that does this aswell called dbus-send.

Here is how you do what we do when doing a powerstate change.

https://wiki.ubuntu.com/DebuggingGNOMEPowerManager

This is more or less exactly what is done when doing a sleep call
dbus-send --system --print-reply --dest="org.freedesktop.Hal" /org/freedesktop/Hal/devices/computer org.freedesktop.Hal.Device.SystemPowerManagement.Suspend int32:0

And if you need references one how to do the commands via cpp you can check
xbmc/linux/HalManager.cpp
namely method PowerManagement @ line 390

When I did the HalManager I based it ontop of Gnome Volume Manager so thats a great reference aswell (not that it deals with dbus that much and it only handle volumes but still a good read on HAL)

Cheers,
Tobias

Thank you Tobias, much more transparent now.
I am going to read if there is any chance to fine tune suspend/ resume parameters by any config files.

Thank you again!
Bence
Reply

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