View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 1 post ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Tue Apr 13, 2010 9:35 pm 
Offline
Joined: Fri Oct 20, 2006 12:04 pm
Posts: 905
Location: LA, CA
I couldn't get the screensaver to ever play nice with Hulu. Whatever I did, I'd get a blank screen while watching Hulu. So I found this and modified as below to pkill xscreensaver and then restart after closing huludesktop. Works a charm. Just copy the script, put in /usr/LH/bin/, chmod 755 and change the default Hulu "button" to call this mythhulu.sh script and enjoy! (There is still probably some 'junk dna' in the script, so feel free to improve as needed.)

mythhulu.sh

Code:
nosaver() {
# Make sure the screensaver is stoped
pkill xscreensaver
PID=$!
echo "$PID" >"$LOCK"
}


do_cleanup() {
# Simple cleanup function
kill -9 $(cat "$LOCK")
rm -f "$LOCK"
/usr/bin/xscreensaver -no-splash &
}

## Trap exit signals for cleanup
trap "{ do_cleanup ; exit 0; }" EXIT

##  Lets create/check a lockfile
LOCK=/tmp/mythhulu.lock
if [ -f "$LOCK" ]; then
  # Another instance is running. Lets confirm
  # Start with a short sleep incase a instance is still being loaded
  sleep 3
  HULU="$(ps ax |grep hulu |grep -v "grep")"
  if [ -n "$HULU" ]; then
    # A Hulu process was detected
    exit 0
  else
    # Stale lock file. Retouch
    rm -f "$LOCK"
    touch "$LOCK"
  fi
else
  touch "$LOCK"
fi


## Nope - Dont blank my TV shows ;-)
nosaver


## If xautomation tools are installed use then to
## move mouse far far off screen
CHECK_XTE=$(which xte)
[ -n "$CHECK_XTE" ] && xte 'mousemove 1000 1000'


##  Start HuluDesktop with elevated priority then exit
##  with its status
HULU_PRIO=0
nice -n $HULU_PRIO /usr/bin/huludesktop
exit $?


/usr/share/mythtv/is.xml

Code:
<mythmenu name="Internet Steams">
<button>
<type>STREAM</type>
<text>Hulu Desktop</text>
<action>EXEC /usr/LH/bin/mythhulu.sh</action>
</button>

</mythmenu>


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu