Forum
  • Search
  • Member List
  • Calendar
Hello There, Guest! Login Register — Login with Facebook

Starting XBMC on hdmi access
Thank you for your donation

Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Threaded Mode | Linear Mode
Starting XBMC on hdmi access
19th Apr, 2013, 07:36 PM
Post: #7
Fred Offline
Registered
Posts: 321
Joined: Apr 2013
Reputation: 36
RE: Get HDMI status from commandline.
Okay I have build this script now as a work around. This script runs forever and should start XBMC on hdmi access and shut it down when the channel is changed away from the hdmi again. The code is below and this code doesn't start or stop anything yet but just prints stuff for debugging.

I would like to get some advice on this, maybe you know a better solution.

Code:
#!/bin/bash
while true

do

cec_client=`cec-client -m | egrep -m 1 '0f:86:30:00|0f:80:00:00:30:00|0f:80:30:00:00:00'`

echo "${cec_client}"

if (( `echo $cec_client | grep -c "0f:86:30:00|0f:80:00:00:30:00"` > 0 ));then
    echo "turning on and waiting"
    sleep 60
    echo "waiting over, restarting"
elif (( `echo $cec_client | grep -c "0f:80:30:00:00:00"` > 0 ));then
    echo "turning off and waiting"
    sleep 60
    echo "waiting over, restarting"
else
    echo "error, restarting" #this is true when there is a segmentation fault
fi

done

I would also like to extend it with option to wait an x amount of time before shutting down, if hdmi is accessed within that time cancel shutdown. But for this I should be able to do actions while cec-client is still running, I don't know how to do that.

Please read rules and do a search before you post! . FAQs . How to post log file? . Looking for answers? Please start here
Find all posts by this user
Quote this message in a reply
« Next Oldest | Next Newest »
Post Reply 


Messages In This Thread
Starting XBMC on hdmi access - Fred - 17th Apr, 2013, 07:18 PM
RE: Get HDMI status from commandline. - rikardo1979 - 18th Apr, 2013, 07:58 AM
RE: Get HDMI status from commandline. - Fred - 18th Apr, 2013, 08:02 PM
Re: Get HDMI status from commandline. - rikardo1979 - 18th Apr, 2013, 08:17 PM
RE: Get HDMI status from commandline. - Fred - 18th Apr, 2013, 10:31 PM
RE: Get HDMI status from commandline. - Fred - 19th Apr, 2013, 02:58 AM
RE: Get HDMI status from commandline. - Fred - 19th Apr, 2013 07:36 PM
RE: Starting XBMC on hdmi access - koper89 - 27th Jan, 2014, 04:35 AM
RE: Starting XBMC on hdmi access - mk01 - 27th Jan, 2014, 09:36 PM

  • View a Printable Version
  • Send this Thread to a Friend
  • Subscribe to this thread
Forum Jump:

Current time: 7th Jun, 2025, 12:02 PM Powered By MyBB, © 2002-2025 MyBB Group.