X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=actions%2Fwatch.sh;h=60d29db336b26b9649b5078bf7a0a3aa81474ada;hb=180a9479b49361d68a684d4f0452f6f32bd79121;hp=01de7d57555739c2bae3a6035cd68dda458a7408;hpb=35837e056ad0b4f4fd915381d97d9523b86d7783;p=serve0 diff --git a/actions/watch.sh b/actions/watch.sh index 01de7d5..60d29db 100755 --- a/actions/watch.sh +++ b/actions/watch.sh @@ -3,10 +3,10 @@ cgi_refdata info="${_GET[i]}" location="$(invalidate "${_GET[l]}" '(.*/)?\.\.(/.*)?|' /)" -order="${_REF[o]}" -search="${_REF[s]}" -filter="${_REF[f]}" -page="${_REF[pn]}" +order="${_POST[o]}" +search="${_POST[s]}" +filter="${_POST[f]}" +page="${_POST[pn]}" watch_link='' [ -n "$location" ] && watch_link="l=$(urlsafe "${location}")&" @@ -71,18 +71,20 @@ case "${_COOKIE[watch]}" in "${_EXEC}"/helpers/genmeta.sh "$playuri" "$playmeta" >/dev/null fi - DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1006 \ - nohup /usr/bin/mplayer -ao pulse \ + export DISPLAY=":0" + 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 \ -slave -input file="$fifofile" \ -volume "$volume" \ "$playuri" >"$statusfile" 2>/dev/null & # # MPlayer2: - # DISPLAY=:0 XDG_RUNTIME_DIR=/run/user/1006 \ - # nohup /usr/bin/mplayer -ao pulse --quiet \ + # nohup /usr/bin/mplayer -ao pulse \ # --slave --input=file="$fifofile" \ # --volume="$volume" \ - # "$playuri" >/dev/null 2>/dev/null & + # "$playuri" >"$statusfile" 2>/dev/null & redirect "?p=playctl&${watch_link}" ;;