Explorar el Código

Detect if MOC is playing

master
Arun Prakash Jana hace 5 años
padre
commit
8fff4643f5
No se encontró ninguna clave conocida en la base de datos para esta firma ID de clave GPG: A75979F35C080412
Se han modificado 1 ficheros con 17 adiciones y 7 borrados
  1. +17
    -7
      plugins/mocplay

+ 17
- 7
plugins/mocplay Ver fichero

@@ -59,15 +59,25 @@ fi
if [ -z "$ret" ]; then
# mocp not running
mocp -S

# clear selection and play
mocp -c
mocp_add "$1"
mocp -p
else
# mocp running, just append
mocp_add "$1"
# mocp running, check if it's playing
state=$(mocp -i | grep "State:" | cut -d' ' -f2)

if [ $state = 'PLAY' ]; then
# add to playlist and exit
mocp_add "$1"

# uncomment the line below to show mocp interface after appending
# mocp

exit
fi
fi

# clear selection and play
mocp -c
mocp_add "$1"
mocp -p

# uncomment the line below to show mocp interface after appending
# mocp

Cargando…
Cancelar
Guardar