mirror of
https://github.com/jarun/nnn.git
synced 2024-11-28 05:41:31 +00:00
mocplay: confirm working with selection
This commit is contained in:
parent
450601bea5
commit
b5ed36bebe
|
@ -20,7 +20,7 @@ SHUFFLE=0
|
||||||
|
|
||||||
mocp_add() {
|
mocp_add() {
|
||||||
if [ $SHUFFLE = 1 ]; then
|
if [ $SHUFFLE = 1 ]; then
|
||||||
if [ -s "$selection" ]; then
|
if [ "$resp" = "y" ]; then
|
||||||
arr=$(tr '\0' '\n' < "$selection")
|
arr=$(tr '\0' '\n' < "$selection")
|
||||||
elif [ -n "$1" ]; then
|
elif [ -n "$1" ]; then
|
||||||
arr="$1"
|
arr="$1"
|
||||||
|
@ -44,7 +44,7 @@ mocp_add() {
|
||||||
done
|
done
|
||||||
|
|
||||||
else
|
else
|
||||||
if [ -s "$selection" ]; then
|
if [ "$resp" = "y" ]; then
|
||||||
xargs < "$selection" -0 mocp -a
|
xargs < "$selection" -0 mocp -a
|
||||||
else
|
else
|
||||||
mocp -a "$1"
|
mocp -a "$1"
|
||||||
|
@ -56,6 +56,11 @@ if [ ! -s "$selection" ] && [ -z "$1" ]; then
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -s "$selection" ]; then
|
||||||
|
echo -n "Work with selection? Enter 'y' to confirm: "
|
||||||
|
read resp
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$ret" ]; then
|
if [ -z "$ret" ]; then
|
||||||
# mocp not running
|
# mocp not running
|
||||||
mocp -S
|
mocp -S
|
||||||
|
@ -76,7 +81,7 @@ fi
|
||||||
|
|
||||||
# clear selection and play
|
# clear selection and play
|
||||||
mocp -c
|
mocp -c
|
||||||
mocp_add "$1"
|
mocp_add "$1" "$resp"
|
||||||
mocp -p
|
mocp -p
|
||||||
|
|
||||||
# uncomment the line below to show mocp interface after appending
|
# uncomment the line below to show mocp interface after appending
|
||||||
|
|
Loading…
Reference in a new issue