diff options
author | EuAndreh <eu@euandre.org> | 2022-08-16 18:55:19 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2022-08-16 18:55:19 -0300 |
commit | 9c79dbda973a375db32cc9bbc69903de49e7377e (patch) | |
tree | a64ec0b6c26473447ef66f95a8cc6d3eb9705390 /bin/tuivid | |
parent | bin/stopwatch: Add working version (diff) | |
download | dotfiles-9c79dbda973a375db32cc9bbc69903de49e7377e.tar.gz dotfiles-9c79dbda973a375db32cc9bbc69903de49e7377e.tar.xz |
bin/tuivid: Add working version
Diffstat (limited to 'bin/tuivid')
-rwxr-xr-x | bin/tuivid | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/bin/tuivid b/bin/tuivid new file mode 100755 index 0000000..54bddcf --- /dev/null +++ b/bin/tuivid @@ -0,0 +1,65 @@ +#!/bin/sh +set -eu + + +usage() { + cat <<-'EOF' + Usage: + tuivid FILE + tuivid -h + EOF +} + +help() { + cat <<-'EOF' + + Options: + -h, --help show this message + + FILE the name of the video file + + + Play a video in the terminal, withut X or a GUI. + + + Examples: + + Play "movie.mp4": + + $ tuivid movie.mp4 + EOF +} + + +for flag in "$@"; do + case "$flag" in + --) + break + ;; + --help) + usage + help + exit + ;; + *) + ;; + esac +done + +while getopts 'h' flag; do + case "$flag" in + h) + usage + help + exit + ;; + *) + usage >&2 + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + + +exec mpv --quiet --vo=tct --vo-tct-256=yes --vo-tct-algo=plain --framedrop=vo "$@" |