Advertisement
Guest User

twitch bash script

a guest
Feb 20th, 2015
590
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.66 KB | None | 0 0
  1. #!/bin/bash
  2. #bash script utilizing livestreamer to play twitch streams
  3. #usage "twitch.sh <stream name>"
  4. #or just invoke the script and enter the stream name you want
  5. #
  6. #save in /usr/bin
  7. #and type "chmod +x twitch.sh"
  8. #you can also add it as an alias in ~/.bashrc or in a custom file, loaded by .bashrc in the format:
  9. #
  10. #alias twitch='twitch.sh'
  11. #alias twi='twitch.sh'
  12. #
  13. #then just type twitch wcs and enjoy :)
  14.  
  15. if [ -n $1 ]; then
  16.     str_input=$1
  17. fi
  18.  
  19. if [ -z $1 ]; then
  20.         echo -n "Stream name? : "
  21.         read str_input
  22. fi
  23.  
  24. echo "Loading twitch stream: twitch.tv/$str_input !"
  25.  
  26. str="livestreamer twitch.tv/space best"
  27. r=${str//space/$str_input}
  28. $r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement