-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathurlopener
More file actions
executable file
·34 lines (26 loc) · 1.13 KB
/
urlopener
File metadata and controls
executable file
·34 lines (26 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
pathToScript=`dirname "$0"`
# function to select video quality
quality_select(){
quality=`echo -e 'low\nmedium\nhigh\naudio'| dmenu -i -p "Select quality" -fn 'roboto mono nerd font:bold:size=11'`
case "$quality" in
"low") echo "--ytdl-format=3gp $url" ;;
"medium") echo "--ytdl-format=webm $url" ;;
"high") echo "--ytdl-format=mp4 $url" ;;
"audio") echo "--ytdl-format=m4a $url" ;;
esac
}
url=`$pathToScript/extract|dmenu -i -l 10 -p Urls -fn 'roboto mono nerd font:bold:size=11'`
[[ $url = "" ]] && exit 1
choose=`echo -e 'qutebrowser\ncopy\nmpv\nts-mpv\nmpv-best-quality\nfeh\naria2c\nfirefox\nchrome'|dmenu -i -p "Open with" \
-fn 'roboto mono nerd font:bold:size=11'`
case "$choose" in
"qutebrowser") qutebrowser $url ;;
"copy") echo "$url" | xclip -selection clipboard ;;
"firefox") firefox $url ;;
"chrome") google-chrome-stable $url ;;
"ts-mpv") video=`quality_select`; notify-send "Queued video";ts mpv $video ;;
"mpv") video=`quality_select`; [[ $video = "" ]] && exit 1 ;notify-send "Playing video";mpv $video ;;
"mpv-best-quality") notify-send "playing video";mpv $url ;;
"feh") feh $url ;;
"aria2c") aria2c $url ;;
esac