executable_firefox-youtube-chat 492 B

123456789101112131415161718
  1. #!/usr/bin/env bash
  2. video="$1"
  3. if [[ $video == http*://www.youtube.com* ]]
  4. then
  5. id=$(echo "$1" | cut -d = -f 2)
  6. notify-send "Open chat $1"
  7. exec -a "$0" chromium --app="https://www.youtube.com/live_chat?v=$id&is_popout=1" "$@"
  8. elif [[ $video == http*://www.twitch.tv* ]]
  9. then
  10. channel=${video##*/}
  11. notify-send "Open chat $1"
  12. exec -a "$0" chromium --app="https://www.twitch.tv/popout/$channel/chat?popout=" "$@"
  13. else
  14. notify-send "Not a YouTube or Twitch steram"
  15. fi