summaryrefslogtreecommitdiffstats
path: root/browser
authorRaghavendra D Prabhu <[email protected]>2011-03-12 18:54:47 (GMT)
committer Raghavendra D Prabhu <[email protected]>2011-03-12 18:54:47 (GMT)
commit5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a (patch) (side-by-side diff)
treedeabb15393558ab3a1a629fc0782d8b0c3124c48 /browser
downloadScripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.zip
Scripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.tar.gz
Scripts-5ec75ea891c9b44cdd2d7a3e0c29b4d08dff2b2a.tar.bz2
Initial scripts update
Diffstat (limited to 'browser') (more/less context) (ignore whitespace changes)
-rwxr-xr-xbrowser53
1 files changed, 53 insertions, 0 deletions
diff --git a/browser b/browser
new file mode 100755
index 0000000..2364ba8
--- a/dev/null
+++ b/browser
@@ -0,0 +1,53 @@
+#!/bin/zsh
+# The main browser script
+URL="$1"
+if [[ $URL == (#i)(*.jpg|*.png|*.jpeg) ]];then
+ notify-send "Browser" "feh for $URL"
+ file=$URL:t
+ file="~/.local/share/feh/$file"
+ if [[ ! -f "$file" ]];then
+ feh -j ~/.local/share/feh/ -k "$URL"
+ else
+ feh $file
+ fi
+ exit
+fi
+
+if [[ $URL == *youtube.com/watch* ]];then
+ notify-send "Browser" "youtube for $URL"
+ #DFILE=
+ #trap 'rm $DFILE;kill $$' TERM
+ #trap '~/bin/mplayeraux stop' INT
+ tubeplay $URL
+ #sleep 2
+ #DFILE=$(ls -Acr |tail -1)
+ #export DFILE
+ exit
+fi
+
+if [[ $URL == (#i)(*.mp3|*.ogg) ]];then
+ notify-send "Browser" "mp3/mplayer for $URL"
+ #echo "$URL" | mpc add
+ localf="${URL:t}"
+ /usr/bin/wget -O - $URL | tee $HOME/media/online/$localf | /usr/bin/mplayer -cache 4096 -cache-min 40 "$URL"
+ exit
+fi
+
+
+OB="firefox"
+isrxvt=0
+
+if [[ $0 == *ubrowser ]];then
+ isrxvt=1
+fi
+
+#if [[ $URL == http://tinyurl* || $num1 == $num2 || ((! -t 1) && $isrxvt == 0) ]];then
+if [[ $URL == http://tinyurl* || $isrxvt == 0 ]];then
+ OB="$BROWSER"
+ $OB -remote "openurl($URL)"
+ #$OB "$URL"
+else
+ OB="$TBROWSER"
+ tmux new-window -a -d -t uake: "echo -e '\a'; $OB $URL"
+fi
+