fix music

This commit is contained in:
thek4n 2026-02-19 23:17:38 +03:00
parent 8d9ba24d6c
commit a46aa7e185

View File

@ -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}" --really-quiet "${url}"
}
cmd_run() {