Resume on home screen?
#1
Hi everyone,

Just wondering, is there away to tell XBMC to reset to the home screen upon resume? I can appreciate this wouldn't necessarily be the program's default action, since some people want it to open up where they left it. But we normally close down XBMC directly on the area of the media library we've been using last; it'd be great if there were some way of telling it to move from that back to the home screen, either as it's shutting down or upon resuming.

Has anyone else tried this or is anyone able to offer advice?

Regards to all,

Discy
Reply
#2
I run the following command in a resume hook to always resume with xbmc on the home screen

Code:
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"jsonrpc": "2.0", "method": "Input.Home", "id": 1}' http://localhost:9191/jsonrpc

jsonrpc needs to be enabled and you need to change the port number in the http address to suit.
Reply
#3
Hi Teeedubb,

That looks fantastically useful, actually. I'm a bit of a Linux ignoramus so I'll need to do some more research on a resume hook etc, but thanks for taking the time to show that something is at least possible! Smile

Kind regards,

Discy
Reply
#4
What distro are you using?
Reply
#5
I'm on xbmcbuntu, Teeedubb.
Reply
#6
I have no experience with xbmcbuntu but this should work. From a terminal type

Code:
sudo nano /etc/pm/sleep.d/80_xbmc-home

Paste in the following (modify the port number to suit)

Code:
#!/bin/sh
# xbmc home screen

if [ "$1" = "resume" ]
then

        curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"jsonrpc": "2.0", "method": "Input.Home", "id": 1}' http://localhost:9191/jsonrpc

fi

Exit and save then make it the hook executable

Code:
sudo chmod +x /etc/pm/sleep.d/80_xbmc-home

And that does it.
Reply
#7
Very kind of you to take the time to offer help on this, teeedubb; I'll give that a try this evening and report back on whether it works, just in case someone discovers this thread in future when trying to achieve the same.

Discy
Reply
#8
Hi teeedubb. I've tried this, and I think I've enabled jsonrpc too ('Allow programs on this system to control XBMC' is checked) but it doesn't appear to be making any difference. Is there another setting that I'm missing?

Kind regards, and thanks again for your help,

Discy

Success! I went back in and turned on webserver and it works! That's terrific, teeedubb - thanks again for all your help!

Regards to all,

Discy
Reply
#9
Hi,

I wanted to try this, but I get :
$ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"jsonrpc": "2.0", "method": "Input.Home", "id": 1}' http://localhost:8080/jsonrpc
* About to connect() to localhost port 8080 (#0)
* Trying ::1... Connection refused
* Trying 127.0.0.1... connected
> POST /jsonrpc HTTP/1.1
> User-Agent: curl/7.22.0 (x86_64-pc-linux-gnu) libcurl/7.22.0 OpenSSL/1.0.1 zlib/1.2.3.4 libidn/1.23 librtmp/2.3
> Host: localhost:8080
> Accept: application/json
> Content-type: application/json
> Content-Length: 51
>
* upload completely sent off: 51out of 51 bytes
< HTTP/1.1 401 Unauthorized
< Content-Length: 0
< Connection: close
< WWW-Authenticate: Basic realm=XBMC
< Date: Fri, 07 Feb 2014 17:55:07 GMT
<
* Closing connection #0


Well I also tried putting the user:password@localhost to the command but with same result, getting the message about the authorization. I tried it locally and I tried it from a second machine. http access and everything is enabled, as I am also using remote utilities over web.

From the formulation it looks to me that there is only the command for returning to home screen, but no command to stop play media (whatsoever), am I right?

Giving:
http://mediabox:8080/jsonrpc?request={"jsonrpc":"2.0","method":"Input.Home","id":1}

over the firefox from a second PC works, so the error must be in the general formulation of passing the http over the curl
Reply

Logout Mark Read Team Forum Stats Members Help
Resume on home screen?0