Created
September 26, 2014 00:37
-
-
Save gevans/317f02d7f8a244d18cb6 to your computer and use it in GitHub Desktop.
Revisions
-
gevans created this gist
Sep 26, 2014 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,25 @@ #!/usr/bin/env bash video_url='https://www.youtube.com/watch?v=dQw4w9WgXcQ' exists() { which "$1" &> /dev/null } os="$(uname)" if [ "$os" = 'Darwin' ]; then open -g "$video_url" else if exists 'chrome'; then chrome "$video_url" elif exists 'google-chrome'; then google-chrome "$video_url" elif exists 'firefox'; then firefox "$video_url" elif exists 'iceweasel'; then iceweasel "$video_url" else echo "$video_url" > /home/*/look-at-this-$$.txt fi fi