From 1c7de9abe3117139d104ab9e4e625fe9c01f7a75 Mon Sep 17 00:00:00 2001 From: tastytea Date: Fri, 5 Apr 2024 01:27:50 +0200 Subject: [PATCH] add rg-dir --- .config/zsh/functions/rg-dir | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 .config/zsh/functions/rg-dir 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}