♻️ refactor(systemd): convert spotdl scripts into 1 and change the name to the services
This commit is contained in:
parent
e13944b5bd
commit
4fd51caee0
5 changed files with 17 additions and 27 deletions
10
.config/systemd/user/downloadSpotify.service
Normal file
10
.config/systemd/user/downloadSpotify.service
Normal file
|
@ -0,0 +1,10 @@
|
|||
[Unit]
|
||||
Description=Download Spotify Lists using spotdl
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/matt/.local/bin/downloadSpotify
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
|
@ -4,7 +4,7 @@ Description=Run Spotdl Sync Weekly
|
|||
[Timer]
|
||||
OnCalendar=Sun 18:00:00
|
||||
Persistent=true
|
||||
Unit=spotdl_sync.service
|
||||
Unit=downloadSpotify.service
|
||||
|
||||
[Install]
|
||||
WantedBy=timers.target
|
|
@ -1,10 +0,0 @@
|
|||
[Unit]
|
||||
Description=Download music using spotdl
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/home/matt/.local/bin/downloadMusic
|
||||
|
||||
[Install]
|
||||
WantedBy=default.target
|
|
@ -16,8 +16,12 @@ FOLDERS=(
|
|||
|
||||
notify-send "Spotdl Sync" "Started syncing..."
|
||||
|
||||
for folder in "${FOLDERS[@]}"; do
|
||||
/home/matt/.local/bin/spotdlSync "$folder" # TODO: Change the path to relative without breaking the systemd service
|
||||
for FOLDER in "${FOLDERS[@]}"; do
|
||||
cd "$HOME/Musica/Listen-To/$FOLDER" || continue
|
||||
|
||||
spotdl sync "${FOLDER,,}.sync.spotdl"
|
||||
|
||||
notify-send "Spotdl Sync" "$FOLDER synced"
|
||||
done
|
||||
|
||||
notify-send "Spotdl Sync Complete"
|
|
@ -1,14 +0,0 @@
|
|||
#!/usr/bin/bash
|
||||
|
||||
FOLDER=$1
|
||||
|
||||
if [ ! -d "$HOME/Musica/Listen-To/$FOLDER" ]; then
|
||||
notify-send "Spotdl Sync" "The folder $FOLDER doesnt exist"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
cd "$HOME/Musica/Listen-To/$FOLDER"
|
||||
|
||||
spotdl sync "${FOLDER,,}.sync.spotdl"
|
||||
|
||||
notify-send "Spotdl Sync" "$FOLDER synced"
|
Loading…
Add table
Reference in a new issue