2009-05-09, 15:18
Hello,
I've been beating my head for 3 days trying to accomplish following scenario:
1. Press "Home" button on a remote (mapped to Keymap.xml to call shell script that closes XBMC and starts fluxbox)
2. Press Home again and it closes Fluxbox and starts XBMC Again
1. It works only if script is called via console, but if it's called via button "Home" it hangs with vertical lines on the screen
2. Works from both console and "Home" button on a remote
1. Script1.sh
#!/bin/sh
sudo /etc/init.d/xbmc stop
sleep 1
sudo cp /home/xbmc/.xsessionTV /home/xbmc/.xsession # (explanation bellow*)
startx
2. Script2.sh
#!/bin/sh
sudo killall -9 fluxbox
sleep 1
sudo /etc/init.d/xbmc start
3. callscript.py
#!/usr/bin/python
import os
os.system('sh /home/xbmc/.xbmc/Script1.sh')
Note that user xbmc is added to sudoers so it doesn't require password for sudo
*I am overwriting ./xsession with my own because I couldn't start fluxbox differently than via command startx
Once /etc/init.d/xbmc start is issued, it will overwrite ./xsession so I added my own with following commands:
firefox &
exec /usr/bin/fluxbox
Note that issuing /etc/init.d/xbmc start will return ./xsession to original state every time.
So script 1 work perfectly only if called from terminal
sh /home/XBMC/.xbmc/script1.sh
if executed from remote control it do
sudo /etc/init.d/xbmc stop
sudo cp /home/xbmc/.xsessionTV /home/xbmc/.xsession
and then hangs on
startx
Have no clue what could be the problem
Any help on this matter is highly appreciated
P.S. Different approach is also more than welcome, I'm aware that I complicated my life with this approach.
Maybe if Fluxbox can be run on top of XBMC is better solution.
Tried running firefox directly from XBMC but it wont allow me using mouse or keyboard and not whole screen was visible?...
I've been beating my head for 3 days trying to accomplish following scenario:
1. Press "Home" button on a remote (mapped to Keymap.xml to call shell script that closes XBMC and starts fluxbox)
2. Press Home again and it closes Fluxbox and starts XBMC Again
1. It works only if script is called via console, but if it's called via button "Home" it hangs with vertical lines on the screen
2. Works from both console and "Home" button on a remote
1. Script1.sh
#!/bin/sh
sudo /etc/init.d/xbmc stop
sleep 1
sudo cp /home/xbmc/.xsessionTV /home/xbmc/.xsession # (explanation bellow*)
startx
2. Script2.sh
#!/bin/sh
sudo killall -9 fluxbox
sleep 1
sudo /etc/init.d/xbmc start
3. callscript.py
#!/usr/bin/python
import os
os.system('sh /home/xbmc/.xbmc/Script1.sh')
Note that user xbmc is added to sudoers so it doesn't require password for sudo
*I am overwriting ./xsession with my own because I couldn't start fluxbox differently than via command startx
Once /etc/init.d/xbmc start is issued, it will overwrite ./xsession so I added my own with following commands:
firefox &
exec /usr/bin/fluxbox
Note that issuing /etc/init.d/xbmc start will return ./xsession to original state every time.
So script 1 work perfectly only if called from terminal
sh /home/XBMC/.xbmc/script1.sh
if executed from remote control it do
sudo /etc/init.d/xbmc stop
sudo cp /home/xbmc/.xsessionTV /home/xbmc/.xsession
and then hangs on
startx
Have no clue what could be the problem
Any help on this matter is highly appreciated
P.S. Different approach is also more than welcome, I'm aware that I complicated my life with this approach.
Maybe if Fluxbox can be run on top of XBMC is better solution.
Tried running firefox directly from XBMC but it wont allow me using mouse or keyboard and not whole screen was visible?...