-
Notifications
You must be signed in to change notification settings - Fork 0
/
menuhandler
executable file
·18 lines (16 loc) · 1.01 KB
/
menuhandler
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/usr/bin/env bash
# Feed this script a link and it will give fuzzel
# some choice programs to use to open it.
case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\nqueue youtube-dl\\nqueue youtube-dl audio\\nsxiv\\nbrowser\\nw3m\\nmpv (float)\\nytv" | fuzzel --log-level=warning -d -i -p "Open link with what program? ")" in
"copy url") echo "$1" | tr -d '\n' | wl-copy -;;
mpv) mpv -quiet "$1" >/dev/null 2>&1 ;;
"mpv (loop)") mpv -quiet --loop "$1" >/dev/null 2>&1 ;;
"mpv (float)") mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 ;;
"queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;;
"queue youtube-dl") tsp youtube-dl --add-metadata -ic "$1" >/dev/null 2>&1 ;;
"queue youtube-dl audio") tsp youtube-dl --add-metadata -xic -f bestaudio/best "$1" >/dev/null 2>&1 ;;
browser) setsid -f "$BROWSER" "$1" >/dev/null 2>&1 ;;
#sxiv) sxiv "$1" >/dev/null 2>&1 ;;
#ytv) pipe-viewer --player=mpv -4 "$1" >/dev/null 2>&1 ;;
ytv) pipe-viewer --player=mpv "$1" >/dev/null 2>&1 ;;
esac