♻️ refactor(bin): notify-send calls are now made through a function in the downloadMusic script
This commit is contained in:
parent
bcc80f632b
commit
bd83f38ba4
1 changed files with 9 additions and 5 deletions
|
@ -1,7 +1,11 @@
|
||||||
#!/usr/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
notify() {
|
||||||
|
notify-send "Spotdl Sync" "$1" --icon=spotify --app-name=spotify
|
||||||
|
}
|
||||||
|
|
||||||
if ! command -v spotdl &>/dev/null; then
|
if ! command -v spotdl &>/dev/null; then
|
||||||
notify-send "Spotdl Sync" "Error: spotdl is not installed" --icon=spotify --app-name=spotify
|
notify "Error: spotdl is not installed"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -14,14 +18,14 @@ FOLDERS=(
|
||||||
"Cyberpunk-Darksynth"
|
"Cyberpunk-Darksynth"
|
||||||
)
|
)
|
||||||
|
|
||||||
notify-send "Spotdl Sync" "Started syncing..." --icon=spotify --app-name=spotify
|
notify "Started syncing..."
|
||||||
|
|
||||||
for FOLDER in "${FOLDERS[@]}"; do
|
for FOLDER in "${FOLDERS[@]}"; do
|
||||||
cd "$HOME/Musica/Listen-To/$FOLDER" || continue
|
cd "$HOME/Musica/Listen-To/$FOLDER" || continue
|
||||||
|
|
||||||
spotdl sync "${FOLDER,,}.sync.spotdl"
|
spotdl sync "${FOLDER,,}.sync.spotdl"
|
||||||
|
|
||||||
notify-send "Spotdl Sync" "$FOLDER synced"
|
notify "$FOLDER synced"
|
||||||
done
|
done
|
||||||
|
|
||||||
notify-send "Spotdl Sync Complete"
|
notify "Spotdl Sync Complete"
|
||||||
|
|
Loading…
Add table
Reference in a new issue