aboutsummaryrefslogtreecommitdiff
path: root/webview.sh
diff options
context:
space:
mode:
Diffstat (limited to 'webview.sh')
-rwxr-xr-xwebview.sh29
1 files changed, 17 insertions, 12 deletions
diff --git a/webview.sh b/webview.sh
index 5877325..ad5d30d 100755
--- a/webview.sh
+++ b/webview.sh
@@ -7,39 +7,44 @@ mpvFiles="mkv mp4 gif"
pqivFiles="png jpg jpeg jpe"
wgetFiles="mp3 pdf"
+# Reproduce in terminal if no X server
+[ -z "$(xset q 2>/dev/null)" ] && mpv -vo caca "$1"
+
# Check youtube link
-if echo "$1" | grep youtube > /dev/null; then
- chosen=$(echo -e "mpv\nmpv (loop)\nmpv (float)\ndownload (y-dl)\nqutebrowser\nw3m" | dmenu -i)
+if echo "$1" | grep youtube >/dev/null; then
+ chosen=$(echo -e "mpv\nmpv (loop)\nmpv (float)\nmpv (terminal)\ndownload (y-dl)\nqutebrowser\nw3m" | dmenu -i)
case "$chosen" in
mpv) nohup mpv "$1" >/dev/null & ;;
"mpv (loop)") nohup mpv --loop "$1" >/dev/null & ;;
- "mpv (float)") ~/scripts/mpvFloat.sh "$1" ;;
+ "mpv (float)") ~/scripts/floats/mpvFloat.sh "$1" ;;
+ "mpv (terminal)") mpv --loop -vo caca "$1" ;;
"download (y-dl)") /home/inigo/scripts/youtube-dlFloat.sh "$1" & ;;
qutebrowser) qutebrowser "$1" & ;;
- qutebrowser) qutebrowser "$1" & ;;
w3m) urxvt -e w3m "$1" & ;;
esac
# General checks
-elif echo $pqivFiles | grep -w $ext > /dev/null; then
+elif echo $pqivFiles | grep -w $ext >/dev/null; then
nohup pqiv -i -P "0,0" -T "pqivfloat" "$1" >/dev/null &
-elif echo $mpvFiles | grep -w $ext > /dev/null; then
- chosen=$(echo -e "mpv\nmpv (loop)\nqutebrowser" | dmenu -i)
+elif echo $mpvFiles | grep -w $ext >/dev/null; then
+ chosen=$(echo -e "mpv\nmpv (loop)\nmpv (terminal)\nqutebrowser" | dmenu -i)
case "$chosen" in
mpv) nohup mpv "$1" >/dev/null & ;;
"mpv (loop)") nohup mpv --loop "$1" >/dev/null & ;;
- "mpv (float)") ~/scripts/mpvFloat.sh "$1" ;;
+ "mpv (float)") ~/scripts/floats/mpvFloat.sh "$1" ;;
+ "mpv (terminal)") mpv --loop -vo caca "$1" ;;
qutebrowser) qutebrowser "$1" & ;;
esac
-elif echo $wgetFiles | grep -w $ext > /dev/null; then
+elif echo $wgetFiles | grep -w $ext >/dev/null; then
nohup wget "$1" >~/log-wget.txt &
else
- chosen=$(echo -e "mpv\nmpv (loop)\npqiv\ndownload (y-dl)\nqutebrowser\nw3m" | dmenu -i)
+ chosen=$(echo -e "mpv\nmpv (loop)\nmpv (terminal)\npqiv\ndownload (y-dl)\nqutebrowser\nw3m" | dmenu -i)
case "$chosen" in
mpv) nohup mpv "$1" >/dev/null & ;;
"mpv (loop)") nohup mpv --loop "$1" >/dev/null & ;;
- "mpv (float)") ~/scripts/mpvFloat.sh "$1" ;;
+ "mpv (float)") ~/scripts/floats/mpvFloat.sh "$1" ;;
+ "mpv (terminal)") mpv --loop -vo caca "$1" ;;
pqiv) nohup pqiv -i -P "0,0" -T "pqivfloat" "$1" >/dev/null & ;;
- "download (y-dl)") /home/inigo/scripts/youtube-dlFloat.sh "$1" & ;;
+ "download (y-dl)") /home/inigo/scripts/floats/youtube-dlFloat.sh "$1" & ;;
qutebrowser) qutebrowser "$1" & ;;
w3m) urxvt -e w3m "$1" & ;;
esac