Forum

Full Version: launch startx from xbmc menu
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Well I have to say i have searched allot but allot to do this, but still going crazy, I am hopping someone kind will be able to guide me or help me sort this out.

I have put a button on the main screen that should shutoff xbmc and run startx. now if I do it manually on ssh works great. I have managed to make a py file with the code, but either xbmc shuts off, or desktop starts but does not show since xbmc is up, and that is depending wich I put on top...

here is how far I have gone, and still no success. I guess the big problem is that my second line of os.system does not start not sure why, and second is that they would need to run at the same time. I hope you all understood my problem. Tongue THANKKKSSSSSSS for all your help..

OH AND BEFORE YOU READ FURTHER.... I AM A NOOB... BlushBlushBlush

Code:
import os

mypass = 'raspberry'
sudo_command1 = 'startx'
sudo_command2 = 'sudo /etc/init.d/xbmc stop'
P = os.system('echo %s|sudo -S %s' % (mypass, sudo_command1))
P = os.system('echo %s|sudo -S %s' % (mypass, sudo_command2))
create a script (executable, in xbians home dir for example)

chmod +x script

put inside :

#!/bin/sh

sudo pkill xbmc.bin
sudo pkill splash
sleep 10

sudo startx

from inside xvmc execute just this one script
Reference URL's