dotfiles

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 0ce19eaeabbc23d47625757da4d14690fbafd49f
parent e8f2d08a8e87fe8b079c256c2fb9464221ec6fcc
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Fri,  9 Mar 2018 15:47:03 -0700

webview update

Diffstat:
M.scripts/webview | 24+++++++++++++++---------
1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/.scripts/webview b/.scripts/webview @@ -1,23 +1,29 @@ #!/bin/bash # Feed script a url. -# Opens the url with xdg-open unless it is an image, -# in which case it downloads in feh. +# If an image, it will view in feh, +# if a video or gif, it will view in mpv +# if a music file or pdf, it will download, +# otherwise it opens link in browser. + +# List of sites that will be opened in mpv. +vidsites="youtube.com + \|hooktube.com + \|bitchute.com + " +detectVidSite() { (echo "$1" | grep "$vidsites">/dev/null) && mpv -quiet $1 > /dev/null & } ext="${1##*.}" mpvFiles="mkv mp4 gif" fehFiles="png jpg jpeg jpe" wgetFiles="mp3 flac opus mp3?source=feed pdf" -pgrep i3 ifi3="i3 exec" - if echo $fehFiles | grep -w $ext > /dev/null; then - nohup feh "$1" >/dev/null & -#elif [[ "$ext" == "gif" ]]; then + feh "$1" >/dev/null & elif echo $mpvFiles | grep -w $ext > /dev/null; then - nohup mpv --loop --quiet "$1" > /dev/null & + mpv --loop --quiet "$1" > /dev/null & elif echo $wgetFiles | grep -w $ext > /dev/null; then - nohup wget "$1" >/dev/null & + wget "$1" >/dev/null & else - nohup $BROWSER "$1" >/dev/null & + detectVidSite "$1" fi