From 355d4996dc32988aabe000fbfaa1a9bbdd9ec585 Mon Sep 17 00:00:00 2001 From: Marcin Chrzanowski Date: Sun, 26 Mar 2023 13:49:36 +0200 Subject: Add initial scripts --- mpvl | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 mpvl (limited to 'mpvl') diff --git a/mpvl b/mpvl new file mode 100755 index 0000000..184dafd --- /dev/null +++ b/mpvl @@ -0,0 +1,22 @@ +#!/bin/bash + +# Starts a media file in mpv looped. +# USAGE: mpvl [ ] +# If only `file` given, loops the whole file. +# If `start` and `stop` given, loops the section between those timecodes. + +FLAGS= +FILE= + +if [ "$#" -eq 3 ]; then + FLAGS="--start=$1 --ab-loop-a=$1 --ab-loop-b=$2" + FILE=$3 +elif [ "$#" -eq 1 ]; then + FLAGS=--loop + FILE=$1 +else + echo "USAGE: mpvl [ ] "; + exit 1; +fi + +mpv $FLAGS "$FILE" -- cgit v1.2.3