From 2140ab51deed88e90eafebf9520fa5f9995dc7c9 Mon Sep 17 00:00:00 2001 From: twells46 <173561638+twells46@users.noreply.github.com> Date: Wed, 31 Dec 2025 13:28:05 -0600 Subject: Migrate from stow --- private_dot_local/bin/executable_rippy | 35 ++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 private_dot_local/bin/executable_rippy (limited to 'private_dot_local/bin/executable_rippy') diff --git a/private_dot_local/bin/executable_rippy b/private_dot_local/bin/executable_rippy new file mode 100644 index 0000000..6b89d5a --- /dev/null +++ b/private_dot_local/bin/executable_rippy @@ -0,0 +1,35 @@ +#!/bin/sh + +if [ "$1" = "-o" ]; then + shift + offset="$1" +fi + +cd "$HOME"/media/music || exit + +abcde -po flac,mp3 || exit + +echo "Ripped successfully" + +dir="$(eza -rs created | head -n1)" +new="../mp3-mirror/$dir-mp3" + +if [ -n "$offset" ]; then + for i in "$dir"/*; do + song_name="${i#*.}" + song_num="${i%%.*}" + song_num="${song_num##*/}" + song_num="${song_num#*0}" + + new_fname="$(printf "%s/%02d.%s\n" "${i%%/*}" "$((song_num + offset + 1))" "$song_name")" + mv "$i" "$new_fname" + done +fi + + +sleep 1 + +[ "$(mkdir ../mp3-mirror/"$new")" ] || printf "\e[0;33mmp3 directory already exists\nCopying files to existing directory\n\e[0m" +mv -v "$dir"/*.mp3 "$new" + +printf "\e[0;32mmp3 mirror successful\e[0m\n" -- cgit v1.2.3