From 7d4085784a2d41df4e11172502b1cb401365de4d Mon Sep 17 00:00:00 2001 From: thek4n Date: Thu, 19 Feb 2026 23:17:38 +0300 Subject: [PATCH] fix music --- home/user/.local/bin/tunes | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/home/user/.local/bin/tunes b/home/user/.local/bin/tunes index fb4a3e2..3b02185 100755 --- a/home/user/.local/bin/tunes +++ b/home/user/.local/bin/tunes @@ -5,6 +5,9 @@ ACTION="${1:-}" PROG="$(basename "${0}")" SOCKET_PATH="/tmp/mpv-${USER}.sock" +#shellcheck disable=SC2064 +trap "rm -f '${SOCKET_PATH}'" INT HUP EXIT + send_cmd() { echo "{ \"command\": ${1} }" | socat - "${SOCKET_PATH}" } @@ -17,7 +20,7 @@ play_playlist() { playlist="${HOME}/Music" fi - exec mpv --input-ipc-server="${SOCKET_PATH}" --shuffle --no-video --ytdl-format=worstaudio "${@}" -- "${playlist}" + mpv --input-ipc-server="${SOCKET_PATH}" --shuffle --no-video --ytdl-format=worstaudio "${@}" -- "${playlist}" } tune_radio() { @@ -71,7 +74,7 @@ play_radio() { exit 1 fi - exec mpv --really-quiet "${url}" + mpv --input-ipc-server="${SOCKET_PATH}" --no-video "${url}" } cmd_run() {