improve scripts

This commit is contained in:
shibao 2024-11-02 15:38:09 -04:00
parent ec66d63089
commit a30bef3b29
5 changed files with 26 additions and 17 deletions

View File

@ -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

View File

@ -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'

View File

@ -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

View File

@ -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"

View File

@ -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"