elif [ -n "${_POST[pasink]+x}" ]; then
stream="$(\
pactl list sink-inputs \
- | sed -rn '/Sink Input #/{:X;N;/application.name =/!bX;s;Sink Input #([0-9]+).+application.name = "MPlayer";\1;p}' \
+ | sed -rn '/Sink Input #/{:X;N;/application.name =/!bX;s;Sink Input #([0-9]+).+application.name = "(MPlayer|mplayer2)";\1;p}' \
)"
pactl move-sink-input "$stream" "${_POST[pasink]}"
elif [ -n "${_POST[osd]+x}" ]; then
export XDG_RUNTIME_DIR="/run/user/$uid" # required for Pulseaudio
xrandr >/dev/null # helps enable all screens
- nohup /usr/bin/mplayer -ao pulse \
- -slave -input file="$fifofile" \
- -volume "$volume" \
- "$playuri" >"$statusfile" 2>/dev/null &
-
- # # MPlayer2:
# nohup /usr/bin/mplayer -ao pulse \
- # --slave --input=file="$fifofile" \
- # --volume="$volume" \
+ # -slave -input file="$fifofile" \
+ # -volume "$volume" \
# "$playuri" >"$statusfile" 2>/dev/null &
+ # MPlayer2: (statusline on stderr)
+ nohup /usr/bin/mplayer -ao pulse \
+ --slave --input=file="$fifofile" \
+ --volume="$volume" \
+ "$playuri" 2>"$statusfile" >/dev/null &
+
chmod 600 "$statusfile"
redirect "?p=playctl&${watch_link}"