aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2022-08-16 18:55:19 -0300
committerEuAndreh <eu@euandre.org>2022-08-16 18:55:19 -0300
commit9c79dbda973a375db32cc9bbc69903de49e7377e (patch)
treea64ec0b6c26473447ef66f95a8cc6d3eb9705390
parentbin/stopwatch: Add working version (diff)
downloaddotfiles-9c79dbda973a375db32cc9bbc69903de49e7377e.tar.gz
dotfiles-9c79dbda973a375db32cc9bbc69903de49e7377e.tar.xz
bin/tuivid: Add working version
-rwxr-xr-xbin/tuivid65
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 "$@"