2014-06-09, 02:36
Hello. I have used XBMC on many different platforms over the years going back to the original xbox in 2004. I have always been able to figure out just about every question I have had by doing a search but this time I'm stumped. My problem is this:
I have Xubuntu 14.04 running on a older PC in my basement. I have a DVI to HDMI cable and a MCE USB IR receiver connected to it that run to the room directly above. Everything works fine after a fresh boot but once I turn the TV off something goes wrong with the HDMI handshake and the TV never re-detects the HDMI signal. This isn't too big of a deal because I can issue a xrandr command over SSH and it redirects the display and works fine.
So what I want to do is remap either the power key (I never power it off and don't need it) or the clear key on the MCE USB remote to call a script that then calls xrandr. I'm also using a Harmony remote so I can easily add that key press whenever the 'Use XBMC' activity starts.
First question:
Since I'm using a MCE USB IR receiver that I believe is detected as a standard keyboard, do I create a ~/.xbmc/userdata/keymap/keyboard.xml file or a ~/.xbmc/userdata/keymap/remote.xml? I have tried both and neither seem to work.
Second question:
I believe I have the content of the keyboard.xml and remote.xml files correct. remote.xml is:
and keyboard.xml is:
Should the System.Exec() reference the python script or a bash script? I tried both, with fixhdmi.py script as:
and the fixhdmi.sh script just contains the xrandr command. I know the bash script works fine because I can call it independently.
So am I on the right track at all here? Is there something obvious I'm missing?
Rather than using <power> in keyboard.xml I have also tried <s> but neither work
Many thanks!
[EDIT: words]
I have Xubuntu 14.04 running on a older PC in my basement. I have a DVI to HDMI cable and a MCE USB IR receiver connected to it that run to the room directly above. Everything works fine after a fresh boot but once I turn the TV off something goes wrong with the HDMI handshake and the TV never re-detects the HDMI signal. This isn't too big of a deal because I can issue a xrandr command over SSH and it redirects the display and works fine.
So what I want to do is remap either the power key (I never power it off and don't need it) or the clear key on the MCE USB remote to call a script that then calls xrandr. I'm also using a Harmony remote so I can easily add that key press whenever the 'Use XBMC' activity starts.
First question:
Since I'm using a MCE USB IR receiver that I believe is detected as a standard keyboard, do I create a ~/.xbmc/userdata/keymap/keyboard.xml file or a ~/.xbmc/userdata/keymap/remote.xml? I have tried both and neither seem to work.
Second question:
I believe I have the content of the keyboard.xml and remote.xml files correct. remote.xml is:
Code:
<keymap>
<global>
<remote>
<clear>System.Exec("/home/spencer/.xbmc/userdata/fixhdmi.py")</clear>
<power>System.Exec("/home/spencer/.xbmc/userdata/fixhdmi.py")</power>
</remote>
</global>
</keymap>
and keyboard.xml is:
Code:
<keymap>
<global>
<keyboard>
<power>System.Exec("/home/spencer/.xbmc/userdata/fixhdmi.py")</power>
</keyboard>
</global>
</keymap>
Should the System.Exec() reference the python script or a bash script? I tried both, with fixhdmi.py script as:
Code:
import os
os.system("/home/spencer/fixhdmi.sh")
and the fixhdmi.sh script just contains the xrandr command. I know the bash script works fine because I can call it independently.
So am I on the right track at all here? Is there something obvious I'm missing?
Rather than using <power> in keyboard.xml I have also tried <s> but neither work
Many thanks!
[EDIT: words]