From 3bb17b40a25bb950b3731eca38ee78add01d3870 Mon Sep 17 00:00:00 2001 From: Luke Smith Date: Mon, 3 Dec 2018 00:59:35 -0500 Subject: [PATCH] wget replaced by curl --- .scripts/tools/dmenuhandler | 9 +++++---- .scripts/tools/linkhandler | 8 +++++--- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.scripts/tools/dmenuhandler b/.scripts/tools/dmenuhandler index 2a3bc0b..f00178b 100755 --- a/.scripts/tools/dmenuhandler +++ b/.scripts/tools/dmenuhandler @@ -2,12 +2,13 @@ # Feed this script a link and it will give dmenu # some choice programs to use to open it. -x=$(printf "mpv\\nmpv (loop)\\nwget\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?") -case "$x" in +case "$(printf "copy url\\nmpv\\nmpv (loop)\\nqueue download\\n\\nqueue youtube-dl\\nfeh\\nbrowser\\nw3m\\nmpv (float)" | dmenu -i -p "Open link with what program?")" in + "copy url") echo "$1" | xclip -selection clipboard ;; mpv) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; "mpv (loop)") setsid mpv -quiet --loop "$1" >/dev/null 2>&1 & ;; - wget) wget "$1" >/dev/null 2>&1 ;; - browser) setsid "$TRUEBROWSER" "$1" & ;; + "queue download") tsp curl -LO "$1" >/dev/null 2>&1 ;; + "queue youtube-dl") tsp youtube-dl --write-metadata -ic "$1" >/dev/null 2>&1 ;; + browser) setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & ;; feh) setsid feh "$1" >/dev/null 2>&1 & ;; w3m) w3m "$1" >/dev/null 2>&1 ;; "mpv (float)") setsid mpv --geometry=+0-0 --autofit=30% --title="mpvfloat" "$1" >/dev/null 2>&1 & ;; diff --git a/.scripts/tools/linkhandler b/.scripts/tools/linkhandler index 54944d5..4f364fc 100755 --- a/.scripts/tools/linkhandler +++ b/.scripts/tools/linkhandler @@ -13,13 +13,15 @@ scihub="http://sci-hub.tw/" [ -z "$1" ] && { "$TRUEBROWSER"; exit; } case "$1" in - *mkv|*webm|*mp4|*gif|*youtube.com*|*hooktube.com*) + *mkv|*webm|*mp4|*gif|*youtube.com*|*youtu.be*|*hooktube.com*|*bitchute.com*) setsid mpv -quiet "$1" >/dev/null 2>&1 & ;; *png|*jpg|*jpe|*jpeg) setsid feh "$1" >/dev/null 2>&1 & ;; *mp3|*flac|*opus|*mp3?source) - setsid tsp wget "$1" >/dev/null 2>&1 & ;; + setsid tsp curl -LO "$1" >/dev/null 2>&1 & ;; *springer.com*) setsid curl -sO "$(curl -s "$scihub$*" | grep -Po "(?<=location.href=').+.pdf")" >/dev/null 2>&1 & ;; - *) setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & ;; + *) + if [ -f "$1" ]; then "$TERMINAL" -e "$EDITOR $1" + else setsid "$TRUEBROWSER" "$1" >/dev/null 2>&1 & fi ;; esac