diff --git a/src/sh/mpv.sh b/src/sh/mpv.sh index f97d7b4..b7a363e 100644 --- a/src/sh/mpv.sh +++ b/src/sh/mpv.sh @@ -78,8 +78,9 @@ mpv_quit() { # Start an mpv instance and bind it to the socket `MPV_SOCKET` mpv_start() { MPV_SOCKET="$(mktemp --suffix=.sock)" + export MPV_SOCKET trap 'mpv_quit >/dev/null; rm -f "$MPV_SOCKET"' EXIT INT - $MPV --no-config --no-terminal --input-ipc-server="$MPV_SOCKET" --idle --no-osc --no-input-default-bindings & + nohup $MPV --no-config --no-terminal --input-ipc-server="$MPV_SOCKET" --idle --no-osc --no-input-default-bindings >/dev/null 2&>1 & } # Play the track at the specified index in the playlist