Fix i3blocks/mpd

This commit is contained in:
Breizh 2022-08-13 00:44:56 +02:00
parent 1ee371f96a
commit fcec99b378

View file

@ -56,14 +56,21 @@ do
read -t 1 BLOCK_BUTTON
case $BLOCK_BUTTON in
1|3) [[ "${o["state"]}" == stop ]] \
&& echo "play" >&${IN} \
&& sed '/^OK$/q' <&$OUT &>/dev/null \
|| self-reset ;;&
2) [[ "${o["state"]}" == stop ]] \
&& echo "play" >&${IN} \
|| echo "pause" >&${IN} \
|| self-reset ;;&
1|3)
if [[ "${o["state"]}" == stop ]]
then
echo "play" >&${IN} || self-reset
sed '/^OK$/q' <&$OUT &>/dev/null
fi
;;
2)
if [[ "${o["state"]}" == stop ]]
then
echo "play" >&${IN} || self-reset
else
echo "pause" >&${IN} || self-reset
fi
;;
1) echo "previous" >&${IN} || self-reset ;;&
3) echo "next" >&${IN} || self-reset ;;&
1|2|3) sed '/^OK$/q' <&$OUT &>/dev/null ;;