[download]

local/bin/grab-menu

   1 #!/bin/bash
   2 
   3 dragon -t -x |
   4 while read url; do case $url in
   5     *4chan*|*4cdn*|*2ch*)
   6         file=~/Pepes/${url##*/}
   7         wget -cO  "$file" "$url" &&
   8         notify-send -i "$file" "file://$file" &
   9     ;;
  10 
  11     *fan.tv*)
  12         mpv $(curl -s "$url" | grep -ao 'https:.*\.mp4') &
  13     ;;
  14 
  15     *)
  16         while read exec; do
  17             [[
  18                 $exec == wget  ||
  19                 $exec == abook ||
  20                 $exec == youtube-dl
  21             ]] && exec="term $exec"
  22 
  23             $exec "$url" &
  24         done < <(
  25             printf '%s\n' mpv abook nemo gvim \
  26             wget youtube-dl chromium luakit | sort |
  27             menu -i grab
  28         )
  29     ;;
  30 esac done