diff --git a/home/default/scripts/generate-playlists b/home/default/scripts/generate-playlists index 5d65bce..d5d7ef6 100755 --- a/home/default/scripts/generate-playlists +++ b/home/default/scripts/generate-playlists @@ -3,6 +3,6 @@ set -ou pipefail for dir in */; do name=`echo "$dir" | sed 's/\/$//g'` - (cd $dir && ls | grep -v -E '\.txt|\.m3u' > "$name.m3u") + (cd $dir && echo "#EXTM3U" > "$name.m3u" && ls | grep -v -E '\.txt|\.m3u' >> "$name.m3u") done diff --git a/home/default/scripts/list-packages b/home/default/scripts/list-packages index f7e62e6..f318c55 100755 --- a/home/default/scripts/list-packages +++ b/home/default/scripts/list-packages @@ -1,7 +1,4 @@ #!/usr/bin/env bash set -eou pipefail -echo $(pacman -Qqe) | \ - tr " " "\n" | \ - sort \ - > /packages.txt +sudo bash -c 'echo $(pacman -Qqe) | tr " " "\n" | sort > /packages.txt' diff --git a/home/default/scripts/standardize-music b/home/default/scripts/standardize-music index 57c3c48..3bf9640 100755 --- a/home/default/scripts/standardize-music +++ b/home/default/scripts/standardize-music @@ -9,7 +9,7 @@ fi count=`ls -1 *.ogg 2>/dev/null | wc -l` if [ $count != 0 ]; then for i in *.ogg; do - ffmpeg -y -i "$i" "${i%.*}.m4a" -map_metadata 0:s:a:0 && rm "$i" + ffmpeg -y -i "$i" "${i%.*}.mp3" && rm "$i" done fi @@ -21,7 +21,7 @@ fi count=`ls -1 *.webm 2>/dev/null | wc -l` if [ $count != 0 ]; then for i in *.webm; do - ffmpeg -y -i "$i" "${i%.*}.m4a" -map_metadata 0:s:a:0 && rm "$i" + ffmpeg -y -i "$i" "${i%.*}.mp3" && rm "$i" done fi @@ -33,9 +33,21 @@ fi count=`ls -1 *.opus 2>/dev/null | wc -l` if [ $count != 0 ]; then for i in *.opus; do - ffmpeg -y -i "$i" "${i%.*}.m4a" -map_metadata 0:s:a:0 && rm "$i" + ffmpeg -y -i "$i" "${i%.*}.mp3" && rm "$i" + done +fi + +count=`ls -1 *.M4A 2>/dev/null | wc -l` +if [ $count != 0 ]; then + rename M4A m4a *.M4A +fi + +count=`ls -1 *.m4a 2>/dev/null | wc -l` +if [ $count != 0 ]; then + for i in *.m4a; do + ffmpeg -y -i "$i" "${i%.*}.mp3" && rm "$i" done fi shopt -s nullglob -rsgain custom -a -s i -L -S *.m4a *.mp3 *.ogg *.opus +rsgain custom -S -L -a -s i *.mp3 *.flac diff --git a/home/default/scripts/sync-car b/home/default/scripts/sync-car index fd62b7a..b4b25eb 100755 --- a/home/default/scripts/sync-car +++ b/home/default/scripts/sync-car @@ -5,15 +5,15 @@ sudo mkdir -p /run/media/default echo "mounting /run/media/default/MUSIC" sudo fsck -fy /dev/disk/by-uuid/E6F8-C183 || true -sudo mkdir /run/media/default/MUSIC +sudo mkdir /run/media/default/MUSIC || true sudo mount -U E6F8-C183 /run/media/default/MUSIC echo "syncing music..." -sudo rsync --info=progress2 -W -r --delete ~/Music/* /run/media/default/MUSIC/ +sudo rsync --info=progress2 -W -r --delete /home/default/Music/* /run/media/default/MUSIC/ sudo sync /run/media/default/MUSIC/ cd /run/media/default/MUSIC -sudo generate-playlists +sudo /home/default/scripts/generate-playlists cd /home/default echo "unmounting /run/media/default/MUSIC" diff --git a/home/default/scripts/sync-mp3-player b/home/default/scripts/sync-mp3-player index 31cc04d..699c24e 100755 --- a/home/default/scripts/sync-mp3-player +++ b/home/default/scripts/sync-mp3-player @@ -4,16 +4,16 @@ set -eou pipefail sudo mkdir -p /run/media/default echo "mounting /run/media/default/MUSIC" -sudo fsck -fy /dev/disk/by-uuid/DB09-89C3 -sudo mkdir /run/media/default/MUSIC -sudo mount -U DB09-89C3 /run/media/default/MUSIC +sudo fsck -fy /dev/disk/by-uuid/4619-9B49 || true +sudo mkdir -p /run/media/default/MUSIC || true +sudo mount -U 4619-9B49 /run/media/default/MUSIC echo "syncing music..." -sudo rsync --info=progress2 -W -r --delete ~/Music/* /run/media/default/MUSIC/ +sudo rsync --info=progress2 -W -r --delete /home/default/Music/* /run/media/default/MUSIC/ sudo sync /run/media/default/MUSIC/ cd /run/media/default/MUSIC -sudo generate-playlists +sudo /home/default/scripts/generate-playlists cd /home/default echo "unmounting /run/media/default/MUSIC"