Created
January 18, 2013 14:36
-
-
Save ncaq/4564954 to your computer and use it in GitHub Desktop.
metaflacの操作がめんどくさくなってきたから書いた.
利便性はゼロに等しい.
恐らくCDの管理自体もっと良い方法が有るはず.
あと初シェルスクリプトだから非常に汚い.
バグとか知らない.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
cd /tmp | |
mkdir ncaqautocd | |
cd ncaqautocd/ | |
ls | grep -v -E '(.jpg|.jpeg|.png)$' | xargs trash | |
yes '' | abcde -1 -M -o flac | |
cp *.jpg */ | |
cp *.jpeg */ | |
cp *.png */ | |
rm *.jpg | |
rm *.jpeg | |
rm *.png | |
cd * | |
flacfile=`ls -d *.flac` | |
cuefile=`ls -d *.cue` | |
imagefile=`ls -d *.jpg *.jpeg *.png` | |
planefile=`echo ${flacfile} | sed -e 's/.flac//'` | |
case "${imagefile}" in | |
*.jpg ) mv ${imagefile} ${planefile}.jpg ;; | |
*.jpeg ) mv ${imagefile} ${planefile}.jpeg ;; | |
*.png ) mv ${imagefile} ${planefile}.png ;; | |
esac | |
imagefile=`ls -d *.jpg *.jpeg *.png` | |
metaflac --import-picture-from=${imagefile} ${flacfile} | |
metaflac --set-tag-from-file=CUESHEET=${cuefile} ${flacfile} | |
cp -b ${flacfile} ~/music | |
mkdir ~/music/.backup/ | |
cp -b ${cuefile} ~/music/.backup/ | |
cp -b ${imagefile} ~/music/.backup/ | |
iconpass=`pwd`/${imagefile} | |
notify-send -i ${iconpass} "CDのリッピングが完了しました" ${planefile}のリッピング完了 | |
cd .. | |
trash * | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment