dotfiles

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

commit 19b951534ca82075b2d353590af9a7f2396b90fd
parent a1b3dbb9c06fc9d92b21fcb527019177997f19e5
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Sun,  1 Apr 2018 09:11:07 -0700

webview moved to linkhandler

Diffstat:
A.scripts/linkhandler | 29+++++++++++++++++++++++++++++
D.scripts/webview | 29-----------------------------
M.urlview | 2+-
3 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/.scripts/linkhandler b/.scripts/linkhandler @@ -0,0 +1,29 @@ +#!/bin/bash + +# Feed script a url. +# 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 + " +ext="${1##*.}" +mpvFiles="mkv mp4 gif webm" +fehFiles="png jpg jpeg jpe" +wgetFiles="mp3 flac opus mp3?source=feed pdf" + +if echo $fehFiles | grep -w $ext > /dev/null; then + feh "$1" >/dev/null & disown +elif echo $mpvFiles | grep -w $ext > /dev/null; then + mpv -quiet "$1" > /dev/null & disown +elif echo $wgetFiles | grep -w $ext > /dev/null; then + wget "$1" >/dev/null & disown +elif echo "$@" | grep "$vidsites">/dev/null; then + mpv -quiet "$1" > /dev/null & disown +else + $BROWSER "$1" 2>/dev/null & disown +fi diff --git a/.scripts/webview b/.scripts/webview @@ -1,29 +0,0 @@ -#!/bin/bash - -# Feed script a url. -# 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 - " -ext="${1##*.}" -mpvFiles="mkv mp4 gif" -fehFiles="png jpg jpeg jpe" -wgetFiles="mp3 flac opus mp3?source=feed pdf" - -if echo $fehFiles | grep -w $ext > /dev/null; then - feh "$1" >/dev/null & -elif echo $mpvFiles | grep -w $ext > /dev/null; then - mpv --loop --quiet "$1" > /dev/null & -elif echo $wgetFiles | grep -w $ext > /dev/null; then - wget "$1" >/dev/null & -elif echo "$@" | grep "$vidsites">/dev/null; then - mpv -quiet "$1" > /dev/null & -else - $BROWSER "$1" 2>/dev/null & disown -fi diff --git a/.urlview b/.urlview @@ -25,5 +25,5 @@ REGEXP (((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t> #COMMAND lynx %s #COMMAND netscape -remote 'openURL(%s)' -COMMAND webview +COMMAND linkhandler