Advertisement
bala150985

RaspberryPI xbmc-send

Jul 4th, 2015
632
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.10 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ $# -ne 1 ]; then
  4.  
  5. echo "To play VIDEO"
  6. echo "      xbmc-send --host=RaspberryPI_IP --port=9777 --action=\"PlayMedia(plugin://plugin.video.youtube/?action=play_video&videoid=p1QUhxpgUds)\""
  7. echo "To show IMAGE"
  8. echo "      xbmc-send --host=RaspberryPI_IP --port=9777 --action=\"ShowPicture(http://i.imgur.com/EuMWHtm.png)\""
  9. echo "To show WINDOW"
  10. echo "      xbmc-send --host=RaspberryPI_IP --port=9777 --action=\"ActivateWindow(Weather)\""
  11.  
  12. fi
  13.  
  14. youtube=`echo $1 | grep youtube | grep -v grep | wc -l`
  15.  
  16. if [ $youtube -gt 0 ]; then
  17.   Vid=`echo $1 | rev | cut -d= -f1 | rev`
  18.   echo "This is the video ID I would ask it to play $Vid"
  19.   echo "xbmc-send --host=RaspberryPI_IP --port=9777 --action=\"PlayMedia(plugin://plugin.video.youtube/?action=play_video&videoid=$Vid)\"" | sh
  20. else
  21.   if [ $1 == "s" ]; then
  22.      control=`echo stop`
  23.      echo "xbmc-send --host=RaspberryPI_IP --port=9777 --action=\"PlayerControl($control)\"" | sh
  24.   elif [ $1 == "p" ]; then
  25.      control=`echo play`
  26.      echo "xbmc-send --host=RaspberryPI_IP --port=9777 --action=\"PlayerControl($control)\"" | sh
  27.   fi
  28. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement