diff --git a/.config/zsh/functions/rg-dir b/.config/zsh/functions/rg-dir new file mode 100755 index 0000000..b114068 --- /dev/null +++ b/.config/zsh/functions/rg-dir @@ -0,0 +1,17 @@ +#!/usr/bin/env zsh +# apply replay gain tags to files in ${1} + +setopt LOCAL_OPTIONS ERR_RETURN NO_UNSET PIPE_FAIL +setopt CSHNULLGLOB # remove non-matching globs but cancel if nothing matches + +local dir=${1} + +rsgain custom \ + --album \ + --tagmode=i \ + --loudness=-18 \ + --clip-mode=p \ + --id3v2-version=keep \ + --opus-mode=d \ + --preserve-mtimes \ + ${dir}/*.{flac,mp3,m4a,opus,ogg,oga,wma,wav,wv,aiff,ape}