From 33e3a0df86e08c1290083d6e6cb2aeedbc13ea5a Mon Sep 17 00:00:00 2001 From: dogeystamp Date: Sun, 14 Aug 2022 14:57:08 -0400 Subject: [PATCH] Move mpv aliases to scripts --- src/.config/fish/aliases.fish | 2 -- src/.local/bin/mpva | 5 +++++ src/.local/bin/mpvs | 10 ++++++++++ 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100755 src/.local/bin/mpva create mode 100755 src/.local/bin/mpvs diff --git a/src/.config/fish/aliases.fish b/src/.config/fish/aliases.fish index ef86f39..81376b9 100644 --- a/src/.config/fish/aliases.fish +++ b/src/.config/fish/aliases.fish @@ -1,8 +1,6 @@ # Color ls alias ls='ls --color=auto' -# Limit mpv and youtube-dl to 1080p so it doesn't use too much bandwidth -alias mpvs='mpv --ytdl-format="bestvideo[ext=mp4][height<=?1080]+bestaudio[ext=m4a]"' # Run mpv from clipboard alias mpvy='mpvs (xsel -b)' diff --git a/src/.local/bin/mpva b/src/.local/bin/mpva new file mode 100755 index 0000000..fa7e63b --- /dev/null +++ b/src/.local/bin/mpva @@ -0,0 +1,5 @@ +#!/bin/bash + +# Run mpv on the output files of minrss + +mpvs $(for v in "$@"; do echo $(head -n 2 "${v}" | tail -n 1 | awk -F\" '{ print $2 }'); done) diff --git a/src/.local/bin/mpvs b/src/.local/bin/mpvs new file mode 100755 index 0000000..df24c44 --- /dev/null +++ b/src/.local/bin/mpvs @@ -0,0 +1,10 @@ +#!/bin/sh + +# Custom mpv settings + +# passed to yt-dl +FORMAT="bestvideo[ext=mp4][height<=?1080]+bestaudio[ext=m4a]" + +mpv \ +--ytdl-format="$FORMAT" \ +$@