]> git.plutz.net Git - serve0/blobdiff - actions/watch.sh
do not close player after meta change
[serve0] / actions / watch.sh
index 60d29db336b26b9649b5078bf7a0a3aa81474ada..e473ac4755d1479bb537272e2972090546effc8a 100755 (executable)
@@ -59,6 +59,7 @@ case "${_COOKIE[watch]}" in
     playmeta="${_DATA}/mplayer.meta"
     fifofile="${_DATA}/mplayer.fifo"
     statusfile="${_DATA}/mplayer.status"
+    statusfile="/tmp/mplayer.status"
     volume="$(validate "$(cat "${_DATA}/mplayer.volume")" '[1-9]?[0-9]|100' 20)"
     [ \! -p "$fifofile" ] && rm -f "$fifofile" && mkfifo -m 600 "$fifofile"
 
@@ -72,7 +73,7 @@ case "${_COOKIE[watch]}" in
     fi
 
     export DISPLAY=":0"
-    uid="$(id |sed -rn '1s;.*uid=([0-9]+)[^0-9].*;1;p')"
+    uid="$(id |sed -rn '1s;.*uid=([0-9]+)[^0-9].*;\1;p')"
     export XDG_RUNTIME_DIR="/run/user/$uid"  # required for Pulseaudio
 
     nohup /usr/bin/mplayer -ao pulse \
@@ -86,6 +87,8 @@ case "${_COOKIE[watch]}" in
     #   --volume="$volume" \
     #   "$playuri" >"$statusfile" 2>/dev/null &
 
+    chmod 600 "$statusfile"
+
     redirect "?p=playctl&${watch_link}"
   ;;
   *) redirect "?p=view&${watch_link}"