]> git.rmz.io Git - dotfiles.git/blob - bin/mkvsettitle
nvim/snacks: replace n with i in dashboard
[dotfiles.git] / bin / mkvsettitle
1 #! /bin/bash
2 # sets the title of all mkv videos to the filename without extension
3
4 dir=${1-.}
5 for f in "$dir"/*; do
6 case "$f" in
7 *.mkv) ext=mkv ;;
8 *.webm) ext=webm ;;
9 *) continue ;;
10 esac
11 t=$(basename "$f" "$ext")
12 t=${t%.*}
13 # remove also (2013){1080p}[en] stuff
14 t=${t% (*)\{*\}*}
15 echo "Set title: $t"
16 mkvpropedit --set title="$t" "$f" > /dev/null
17 done