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}")&"
"${_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}"
;;