commit 1d80419463f94c2b972500fdfa0b6e51007e2f51 parent c46921874046d201b2433c7d007847e4809b22e6 Author: Anders Damsgaard <anders@adamsgaard.dk> Date: Mon, 5 Aug 2019 21:27:27 +0200 Add youtube-dl functionality to linkhandler Diffstat:
M | .local/bin/linkhandler | | | 6 | +++++- |
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/.local/bin/linkhandler b/.local/bin/linkhandler @@ -11,7 +11,7 @@ for url in "$@"; do "$TERMINAL" -e "$EDITOR $url" else #url="$(printf "%s" "$url" | sed 's|http.*://scholar\.google\..*url=||;s|&rt=.*$||')" - action="$(printf "Open\nOpen (Tor Browser)\nCopy URL\ncURL\nHtml to pdf\nSci-Hub\nAdd reference\nmpv" | dmenu_themed -i -p "Action:")" + action="$(printf "Open\nOpen (Tor Browser)\nCopy URL\ncURL\nHtml to pdf\nSci-Hub\nAdd reference\nmpv\nyoutube-dl\nyoutube-dl-music" | dmenu_themed -i -p "Action:")" if [ "$action" = "Open" ]; then setsid xdg-open "$url" >/dev/null 2>&1 & elif [ "$action" = "Open (Tor Browser)" ]; then @@ -33,6 +33,10 @@ for url in "$@"; do getdoi "$url" | getref --notify >> "$BIB" & elif [ "$action" = "mpv" ]; then setsid mpv -quiet "$url" >/dev/null 2>&1 & + elif [ "$action" = "youtube-dl" ]; then + setsid tsp youtube-dl "$url" >/dev/null 2>&1 & + elif [ "$action" = "youtube-dl-music" ]; then + setsid $TERMINAL -e youtube-dl-music "$url" & else notify-send "${0##/*}" "Error: Action not understood" exit 1