add play script for mpv + youtube-dl integration

I recommend binding play to a key via sxhkd. Enjoy streaming video from
anywhere, without allowing all the javascripts in your browser.
This commit is contained in:
Pig Monkey 2016-04-15 17:56:41 -07:00
parent 5db68aed28
commit c29f7c22df
3 changed files with 23 additions and 0 deletions

View file

@ -78,6 +78,7 @@ browser_choices:
- firefox -P work
- firewarden chromium
- tor-browser-en
- play
- qcode
passwordless_sudo:

19
roles/mpv/files/play.sh Executable file
View file

@ -0,0 +1,19 @@
#!/bin/sh
#
# Take advantage of mpv's youtube-dl integration to easily watch videos outside
# of the browser. Use sxhkd or xbindkeys to bind this script to a key. When
# you're on a YouTube page, copy the URL to your clipboardand and hit your key
# binding; the video will automatically begin streaming via mpv.
###############################################################################
read -t 0 stdin
if [ -n "$stdin" ]; then
source="$stdin"
elif [ -n "$1" ]; then
source="$1"
else
source=$(xclip -o -selection clipboard)
fi
eval mpv "$source"

View file

@ -15,3 +15,6 @@
- activate firejail profiles
tags:
- firejail
- name: Push play script
copy: src=play.sh dest=/usr/local/bin/play mode=0755