1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- #!/bin/bash
- # Packages
- # vorbis-tools
- # cdlabelgen
- # atril
- clear
- # test input parameter
- if [ "$1" != "" ]; then
- cd $1
- fi
- # switch
- y=0
- # generate song list
- for i in *.ogg
- do
- if [ $y -eq 0 ]
- then
- y=1
- title=`ogginfo "$i" | grep ALBUM= | cut -d \= -f 2`
- artist=`ogginfo "$i" | grep ALBUMARTIST= | cut -d \= -f 2`
- year=`ogginfo "$i" | grep DATE= | cut -b 7,8,9,10`
- echo '{#MB}'$title >> sl-utf-8.txt
- echo '{#M}'$artist >> sl-utf-8.txt
- echo '{#M}'$year >> sl-utf-8.txt
- echo ' ' >> sl-utf-8.txt
- fi
- song_name=`ogginfo "$i" | grep TITLE | cut -d \= -f 2`
- track_number=`ogginfo "$i" | grep TRACKNUMBER | cut -d \= -f 2`
- echo $track_number $song_name >> sl-utf-8.txt
- done
- # convert list from utf-8 to ascii
- iconv -f UTF-8 -t ASCII//TRANSLIT sl-utf-8.txt > sl-ascii.txt
- # convert cover image to eps
- convert cover.* cover.eps
- # generate cd cover
- cdlabelgen -D -m -w -f sl-ascii.txt -e cover.eps -S 0 -o cd_cover.ps
- # convert cd cover to pdf
- ps2pdf cd_cover.ps cd_cover.pdf
- # view it
- atril cd_cover.pdf
- # delete temporary files
- rm sl-ascii.txt
- rm sl-utf-8.txt
- rm cover.eps
- rm cd_cover.ps
- exit
|