Kodi Community Forum

Full Version: [LIVE] VNC start script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I have installed x11vnc and vnc-java to allow my iphone app, Hipporemote, to control XBMC.

How can I have this run automatically at XBMC startup?

x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800

I tried to read the docs on python, but they are over my head and seem to be quite advanced. I'm sure this is probably easy. I understand the autoexec.py, but don't know how to structure the script, itself.

Any help would be greatly appreciated. I just found XBMC last week and find it to be amazing.
how does xbmc initially start? if xbmc is the only thing your pc does, run your command at system start. if your machine is used for other things, run a script that both starts vnc and starts xbmc.

if you do want to go down the autoexec.py route, then it looks like you need to add something like this to it:
Code:
xbmc.executescript('/path/to/myVNCScript.py')

then you need to add a myVNCScript.py script that launches your command:

Code:
#!/usr/local/bin/python

import subprocess
def app():
    subprocess.call("x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800", executable="bash", shell=True)

if __name__ == '__main__':
    app()


that'll probably work im guessing. probably easier to launch xbmc differently though. where you now launch it with the command:
Code:
xbmc

launch it with
Code:
x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800 & xbmc
Thank you, I'll give that a try.
aeiah Wrote:how does xbmc initially start? if xbmc is the only thing your pc does, run your command at system start. if your machine is used for other things, run a script that both starts vnc and starts xbmc.

if you do want to go down the autoexec.py route, then it looks like you need to add something like this to it:
Code:
xbmc.executescript('/path/to/myVNCScript.py')

then you need to add a myVNCScript.py script that launches your command:

Code:
#!/usr/local/bin/python

import subprocess
def app():
    subprocess.call("x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800", executable="bash", shell=True)

if __name__ == '__main__':
    app()


that'll probably work im guessing. probably easier to launch xbmc differently though. where you now launch it with the command:
Code:
xbmc

launch it with
Code:
x11vnc -forever -usepw -httpdir /usr/share/vnc-java/ -httpport 5800 & xbmc

How can I update my XBMC Live install to boot with the full command instead of the standard xbmc one. I'm fairly new to linux and theres no way I can figure out how to do that using terminal without further instruction. Can anyone help?