From 0a82495aaf6db374994ae0e00978fd7a1299ff60 Mon Sep 17 00:00:00 2001 From: ksyasuda Date: Tue, 25 Feb 2025 01:32:34 -0800 Subject: [PATCH] update icon path --- mpv-add.sh | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/mpv-add.sh b/mpv-add.sh index 9fd0805..4c9a8f1 100755 --- a/mpv-add.sh +++ b/mpv-add.sh @@ -4,24 +4,25 @@ set -Eeuo pipefail URL="${1:-$(wl-paste -p)}" MPV_SOCKET=/tmp/mpvsocket +ICON_PATH="$HOME/.local/share/icons/Magna-Glassy-Dark-Icons/apps/48/mpv.svg" if [[ -z "$URL" ]]; then - notify-send -i mpv "No URL provided" - exit 1 + notify-send -i "$ICON_PATH" "No URL provided" + exit 1 fi if ! [[ -f "$URL" ]] && ! yt-dlp --simulate "$URL"; then - notify-send -i mpv "Invalid URL" - exit 1 + notify-send -i "$ICON_PATH" "Invalid URL" + exit 1 fi -if ! pgrep -x mpv &>/dev/null; then - mpv "$URL" &>/dev/null & - notify-send -i mpv "Playing $URL" +if ! pgrep -x mpv &> /dev/null; then + mpv "$URL" &> /dev/null & + notify-send -i "$ICON_PATH" "Playing $URL" else - if echo "{ \"command\": [\"script-message\", \"add_to_queue\", \"$URL\" ] }" | socat - "$MPV_SOCKET" &>/dev/null; then - notify-send -i mpv "Added $URL to queue" - else - notify-send -i mpv "Failed to add $URL to queue" - fi + if echo "{ \"command\": [\"script-message\", \"add_to_queue\", \"$URL\" ] }" | socat - "$MPV_SOCKET" &> /dev/null; then + notify-send -i "$ICON_PATH" "Added $URL to queue" + else + notify-send -i "$ICON_PATH" "Failed to add $URL to queue" + fi fi