From bd83f38ba4e03bfc53dcf00dc755db227effb851 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sergio=20La=C3=ADn?= Date: Sun, 7 Jan 2024 18:09:54 +0100 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor(bin):=20notify-se?= =?UTF-8?q?nd=20calls=20are=20now=20made=20through=20a=20function=20in=20t?= =?UTF-8?q?he=20downloadMusic=20script?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .local/bin/downloadSpotify | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/.local/bin/downloadSpotify b/.local/bin/downloadSpotify index 47f94b25..f046f104 100755 --- a/.local/bin/downloadSpotify +++ b/.local/bin/downloadSpotify @@ -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 - notify-send "Spotdl Sync" "Error: spotdl is not installed" --icon=spotify --app-name=spotify + notify "Error: spotdl is not installed" exit 1 fi @@ -14,14 +18,14 @@ FOLDERS=( "Cyberpunk-Darksynth" ) -notify-send "Spotdl Sync" "Started syncing..." --icon=spotify --app-name=spotify +notify "Started syncing..." for FOLDER in "${FOLDERS[@]}"; do cd "$HOME/Musica/Listen-To/$FOLDER" || continue spotdl sync "${FOLDER,,}.sync.spotdl" - notify-send "Spotdl Sync" "$FOLDER synced" + notify "$FOLDER synced" done -notify-send "Spotdl Sync Complete" +notify "Spotdl Sync Complete"