[download]

local/bin/grab-menu

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