tlink-open - scripts - various script and utils
 (HTM) git clone git://z3bra.org/scripts
 (DIR) Log
 (DIR) Files
 (DIR) Refs
       ---
       tlink-open (772B)
       ---
            1 #!/bin/sh
            2 
            3 URI="$*"
            4 
            5 # yank URI first, just in case :)
            6 printf '%s' "$URI" | xsel -i
            7 
            8 case $URI in
            9     *.jp*g|*.png) img "$URI";;
           10     *.webm|*.mp4|*.ogv) mplayer -geometry 1280x720 "$URI";;
           11     *.gif) mplayer -geometry 1280x720 "$URI";;
           12     *youtube.com/*) uplay "$URI";;
           13     *.html) surf "$URI";;
           14     *.txt) st -e sh -c "curl -s '$URI'|less -R";;
           15     gopher://*) st -e cgo  $URI ;;
           16     *) thingmenu -g 140x182 -x         \
           17         "picture"    "img '$URI'"      \
           18         "video"      "mplayer -cache 512 '$URI'"  \
           19         "kinda vid"  "uplay '$URI'"  \
           20         "text file"  "st -e sh -c 'curl -s $URI | less -X'" \
           21         "donlad"     "download $URI" \
           22         "web shit"   "surf '$URI'" 2>/dev/null \
           23         "yank fuck"  "echo '$URI' | tr -d '\n' | xsel -i"
           24         ;;
           25 esac