Add scrpits

This commit is contained in:
Out Of Ideas 2024-03-03 16:32:28 -06:00
parent 59c0f1fbee
commit 5f0a8787b9
7 changed files with 36 additions and 3 deletions

6
album-art Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
cover="cover.jpg"
for file in *; do
ffmpeg -y -i $file -i $cover -map 0:a -map 1 -codec copy -metadata:s:v title="Album cover" -metadata:s:v comment="Cover (front)" -disposition:v attached_pic $file
done

7
convert-to-flac Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
for file in *.mp3; do
newfile="$(echo "$file" | sed '$ s/.mp3//')"
echo $newfile
ffmpeg -i "$file" -c:a flac "${newfile}.flac"
rm "$file"
done

View File

@ -154,7 +154,7 @@ CheckAt()
############################################################
# Main Program #
############################################################u
############################################################
############################################################
# Sanity checks #
@ -183,7 +183,7 @@ SECOND="1000"
# Habits
# HABIT TIME DURATION Message
# PRACTICE=("09:00" "$HOUR" "Practice")
#TEST=("$(date -d '+1 minute' '+%H:%M')" "$MINUTE" "This is a test")
TEST=("$(date -d '+1 minute' '+%H:%M')" "$MINUTE" "This is a test")
PRACTICE_GUITAR=("17:00" "$((2 * $HOUR))" "Practice Guitar")
PRACTICE_KARATE=("19:00" "$((2 * $HOUR))" "Practice Karate")
STRETCH=("19:00" "$((2 * $HOUR))" "Stretch")

View File

@ -144,7 +144,7 @@ CheckUser()
CheckMetaflac()
{
# If 'notify-send' command is not found, we exit the program
# If 'metaflac' command is not found, we exit the program
if ! type metaflac &> /dev/null; then
echo "Error: 'metaflac' command not found. Please install metaflac."
exit 1

6
set-title Executable file
View File

@ -0,0 +1,6 @@
#!/bin/sh
# 01 Song Title
for file in *.flac; do
title="$(echo "$file" | sed '$ s/.flac//' | sed '0,/[[:digit:]][[:digit:]]/s///' | sed '0,/\s/s///')"
metaflac --set-tag=Title="$title" "$file"
done

9
set-tracknumber Executable file
View File

@ -0,0 +1,9 @@
#!/bin/sh
# 01 Song Title
nots="$(ls *.flac | wc -l)" # Number of tracks
for file in *.flac; do
not=$(echo $file | awk '{print $1}') # Number of track
track="$not/$nots" # i.e. 01/14
metaflac --set-tag=Track=$track "$file"
done

5
test Executable file
View File

@ -0,0 +1,5 @@
#!/bin/sh
for file in *; do
echo "$file"
done