WIP support for custom shutdown hooks with possible shutdown prevention
#16
Thanks for explaining and testing.
If it's true what you say, that it only works for outside xbmc, then it's not completely useful for me.
Not really a problem but would be nice if it could.
Reply
#17
(2014-09-04, 21:56)wsnipex Wrote: I like the idea, could really be useful.
If you want to get this in mainline, it needs at least using native methods to pop notifications and moving the logic from the header to a cpp.

thanks to some hints of wsnipex, i optimized some parts of the code to do things in a more common way of xbmc:
  • the curl hack for xbmc-notifications is now replaced with a native xbmc function (7f6f169)
  • using CLog instead of cout (c212035)
  • using special://home/ (3b242c6) instead of using an own function to get the home directory of the xbmc user

patches 0007-0009 are added to the first post.

the logic moving is still a needed todo.
Reply
#18
it shouldn't be difficult to allow running xbmc-addons(python scripts) as hooks as well. Although I don't see a usecase for that right now
Reply
#19
(2014-09-08, 16:42)wsnipex Wrote: it shouldn't be difficult to allow running xbmc-addons(python scripts) as hooks as well. Although I don't see a usecase for that right now
For me logoff user on hibernate would be very useful.
Update and Clean lib on shutdown / hibernate would also be handy.
Reply
#20
both is possible from outside as well.
Reply
#21
(2014-09-08, 21:03)wsnipex Wrote: both is possible from outside as well.
oO ow, how?
Reply
#22
write a hook script for sven88s work that uses json-rpc.
Reply
#23
(2014-09-07, 20:00)sven88 Wrote:
(2014-09-04, 21:56)wsnipex Wrote: I like the idea, could really be useful.
If you want to get this in mainline, it needs at least using native methods to pop notifications and moving the logic from the header to a cpp.

thanks to some hints of wsnipex, i optimized some parts of the code to do things in a more common way of xbmc:
  • the curl hack for xbmc-notifications is now replaced with a native xbmc function (7f6f169)
  • using CLog instead of cout (c212035)
  • using special://home/ (3b242c6) instead of using an own function to get the home directory of the xbmc user

patches 0007-0009 are added to the first post.

the logic moving is still a needed todo.

functions and class stuff is now separated (89b93f2)
and i also did a rebase against the latest gotham version (867305b)
compiled and it's still working.


(2014-09-08, 17:44)schumi2004 Wrote:
(2014-09-08, 16:42)wsnipex Wrote: it shouldn't be difficult to allow running xbmc-addons(python scripts) as hooks as well. Although I don't see a usecase for that right now
For me logoff user on hibernate would be very useful.
Update and Clean lib on shutdown / hibernate would also be handy.

right now i don't know how this is done in xbmc at other parts of the code,
but before i'm looking for that, i have some other things in mind to do first.

next thing i wanna do is a simple enable/disable button at the gui settings.

(2014-09-08, 21:03)wsnipex Wrote: both is possible from outside as well.

when i'm not wrong you could workaround with every built-in function and 'command=ExecBuiltin()' through the http interface.
Reply
#24
@sven88 thanks. I'll wait until that is finished before I compile again.

Going to try @wsnipex suggestion now using json.
Reply
#25
@sven88
Could you squash the commits to a single one so i can test it against latest OpenELEC 4.1.6 like you did before?
Reply
#26
(2014-09-10, 12:50)schumi2004 Wrote: @sven88
Could you squash the commits to a single one so i can test it against latest OpenELEC 4.1.6 like you did before?

of course, here is a patch with all commits so far: fb_shutdownHookCheck-AllInOnePatch-2014.09.08-89b93f2.patch
Reply
#27
(2014-09-10, 14:01)sven88 Wrote:
(2014-09-10, 12:50)schumi2004 Wrote: @sven88
Could you squash the commits to a single one so i can test it against latest OpenELEC 4.1.6 like you did before?

of course, here is a patch with all commits so far: fb_shutdownHookCheck-AllInOnePatch-2014.09.08-89b93f2.patch
Thanks Wink

(2014-09-08, 21:13)wsnipex Wrote: write a hook script for sven88s work that uses json-rpc.
@wsnipex can you give me some directions to accomplish this?

I checked json-rpc documentation but there isn't anything that allows me to logoff user, only thing i could find is to activate login window.
https://github.com/xbmc/xbmc/blob/master...ations.cpp

Is that what you mean?
Reply
#28
not sure what you mean exactly with logoff user. Return to the window manager login screen or load the master profile in xbmc?
the former can be done with loginctl terminate-session the latter by calling the "Loadprofile() built-in.
For DB update use the UpdateLibrary(database,[path]) built-in or the equivalet in json.

the easiest way to send the actions is the xbmc-send script included in xbmc, or use json.

edit: http://wiki.xbmc.org/index.php?title=Lis..._functions
Reply
#29
(2014-09-10, 18:56)wsnipex Wrote: not sure what you mean exactly with logoff user. Return to the window manager login screen or load the master profile in xbmc?
the former can be done with loginctl terminate-session the latter by calling the "Loadprofile() built-in.
For DB update use the UpdateLibrary(database,[path]) built-in or the equivalet in json.

the easiest way to send the actions is the xbmc-send script included in xbmc, or use json.

edit: http://wiki.xbmc.org/index.php?title=Lis..._functions
Thanks for the hints.
I tested with activate window loginscreen using json and actually that is what i want when i mentioned user logoff. It presents the loginscreen when recovering from hibernate so it works. Wink
Reply
#30
nice, feel free to share the scripts Wink
Reply

Logout Mark Read Team Forum Stats Members Help
support for custom shutdown hooks with possible shutdown prevention0